配列をプリントする時の区切り文字を変える
- 2009.03.30
- perl

配列をprintする時の区切り文字を変えるには $" に代入するだけ。
@list= (1,2,3,4);
$" = ',';
print "@list";
実行結果
1,2,3,4
ただし、
print @list;
"" (だぶるクォート)無しだと反映されない。
-
前の記事
PhpMyAdminの導入 2009.02.17
-
次の記事
eval{}; 中のreturn(); に注意 2009.04.08