Perlについての質問箱 47箱目
■ このスレッドは過去ログ倉庫に格納されています
0111デフォルトの名無しさん
2011/06/04(土) 02:59:27.40>>107
http://perldoc.jp/docs/perl/5.10.0/perlref.pod
#!/usr/bin/perl -w
use strict;
my @map = map [ (1) x 3 ], 0..4; # リストリファレンスを5回作る
print '$map[', $_, '] = ', "$map[$_]\n" for 0..$#map;
print "---\n";
@map = ([(1) x 3]) x 5; # 一度作ったリストリファレンスのコピーを5個入れる
print '$map[', $_, '] = ', "$map[$_]\n" for 0..$#map;
__END__
■ このスレッドは過去ログ倉庫に格納されています