perl中heredoc的使用解析

中国E盟技术小编今日給您带来一篇perl中heredoc的使用解析,在成块打印文本的时候特别有用,正需要这方面知识点的同学千万不能错过喔!

格式

print <you text go here
EOF

复制代码 代码如下:

sub usage{
print <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中heredoc的使用解析就介绍完成了,如果您还有什么不清楚可以留言给我,如果觉得我写得不错的话,请给我一个大拇指,谢谢!