文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>获取perl脚本当前行行号和脚本名称

获取perl脚本当前行行号和脚本名称

时间:2008-11-12  来源:mouse.rice

(The Script) #!/usr/bin/perl # Program, named literals.perl, written to test special literals 1 print "We are on line number ", _ _LINE_ _, ".\n"; 2 print "The name of this file is ",_ _FILE_ _,".\n"; 3 _ _END_ _ And this stuff is just a bunch of chitter–chatter that is to be ignored by Perl. The _ _END_ _ literal is like Ctrl–d or \004.[a] (Output) 1 We are on line number 3. 2 The name of this file is literals.perl.

Explanation

  1. The special literal _ _LINE_ _ cannot be enclosed in quotes if it is to be interpreted. It holds the current line number of the Perl script.

  2. The name of this script is literals.perl. The special literal _ _FILE_ _ holds the name of the current Perl script.

  3. The special literal _ _END_ _ represents the logical end of the script. It tells Perl to ignore any characters that follow it.

排行榜 更多 +
易欧交易所app免费版

易欧交易所app免费版

金融理财 下载
永远的蔚蓝星球手游下载

永远的蔚蓝星球手游下载

角色扮演 下载
我的恐龙学校

我的恐龙学校

模拟经营 下载