from:http://stackoverflow.com/questions/739214/how-do-i-output-each-perl-array-element-surrounded-in-quotes
例如:
/home/a/j/nomad2:cat 1
#!/usr/bin/perl
my @strArray = ("abc", "bcd");
my $text = do { local {1}quot; = q<",">; qq<"@strArray"> };
print "$text\n";
/home/a/j/nomad2:./1
"abc","bcd"
本文介绍了一种Perl脚本技巧,演示了如何将数组中的每个元素用引号包围并输出。通过使用特殊的字符串引用方法,可以实现这一功能。
1118

被折叠的 条评论
为什么被折叠?



