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中将数组元素输出时,每个元素都包含在引号内。
2169

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



