详细用法,可以查看perl用户手册。 perldoc -f print perldoc -f printf perldoc -f sprintf 他们各自支持的命令格式,都有三四种。但是常用的,也就一两种。 print 常用: print LIST print FILEHANDLE LIST
| 详细用法,可以查看perl用户手册。 perldoc -f print  他们各自支持的命令格式,都有三四种。但是常用的,也就一两种。 常用: print LIST  不常用(主要是因为隐含的细节,会导致阅读上的障碍吧): print FILEHANDLE  
 printf常用: printf FORMAT, LIST  不常用(主要是因为隐含的细节,会导致阅读上的障碍吧): printf FILEHANDLE  
 sprintf命令格式,只有一种: sprintf FORMAT, LIST 
 另外,sprinf还有很多复杂的用法,个人不常用。具体参考perldoc -f sprintf 例如: 
 区别
 参考文档http://perldoc.perl.org/functions/print.html http://perldoc.perl.org/functions/printf.html http://perldoc.perl.org/functions/sprintf.html |