广州葆元健康生物科技有限公司


perl中heredoc使用说明

网络编程 perl中heredoc使用说明 06-21

格式

print <<EOF
you text go here
EOF


sub usage{
print <<EOF;
Usage: test.pl -c config, -f file -l lines
-c config file
-f file name
-l number of lines
EOF
}

NOTE: the last EOF must start at the beginning of the line!!!
you can use other words instead of EOF

Perl使用chdir的实例代码
usestrict;usewarnings;#Printallfilesinadirectorysubprint_files{my$dir='d:/code';opendirDIR,$dirordie$!;my@files=readdirDIR;chdir$dir;#Usechdiror-fwillnotwork,since-fneedabsolutelypathforeachmy$file(@f

perl特殊符号及默认的内部变量
Perl的特殊符号@数组$x{}x名字前面是美元符号($),后面是花括号({}),则其为hash元素%要引用整个hash,使用百分号()作为前缀。前面几页中使用的hash的名字为%fa

perl中my与our的区别介绍
先来看下our的用法。require5.006当版本号小于5.006的时候,会返回失败,从而导致模块加载失败。所以它的作用就是保证模块调用环境的Perl版本。our和my一


编辑:广州葆元健康生物科技有限公司

标签:百分号,模块,名字,特殊符号,前缀