ハッシュのなかには、配列のリファレンスを入れる。 #!/usr/bin/perl $test{'foo'} = ["abc", "lmn", "opq", "xyz"]; @a = (100, 200, 300); $test{'bar'} = \@a; print $test{'foo'}[1] . "\n"; print $test{'bar'}[2] . "\n"; print "----\n"; foreach (@{$test{'foo'}}) { print; print "\n"; } print "----\n"; foreach (@{$test{'bar'}}) { print; print "\n"; } print "----\n"; foreach $key (keys %test) { foreach (@{$test{$key}}) { print "$key: $_\n"; } }