Perl引号

擦擦鞋,伸腿,准备开始踹开Perl大门

今天来个Perl引号

Perl引号
跟随命令敲起来
###双引号
$num = 5;
print "The number is $num.\n";
print "I need \$5.00.\n";
print "\t\tI can't help you.\n";


###单引号
print 'I need $100.00',"\n";
print 'The string literal, \t, is used to represent a tab.',"\n";
print 'She cried, "Help me!"',"\n";


###反引号
print "The date is ", `date`;
print "The date is `date`",".\n";
$directory = `pwd`;
print "\nThe current directory is $directory.";

####Perl引号替换符号
print 'She cried, "I can\'t help you!"',"\n";
print qq/She cried,"I can't help you!"/,"\n";
print qq(I need $5.00\n);
print q/I need $5.00\n/;
print qq(I need \$5.00\n);
print q!I need $5.00!,"\n";   #No output
print "The present workding directory is ", `pwd`;
print qq/Today is /, qx/date/;
print "The hour is ",qx{date +%H};
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。