in reply to Doubt on hash keys
What did you expect it to print?
use Data::Dumper; my %hash = ( 'hi' => ('hello' => 'all'), 'bye' => ('later' => 'gone') ); print Dumper \%hash; __END__ $VAR1 = { 'hi' => 'hello', 'later' => 'gone', 'all' => 'bye' };
The "sublists" that you think you have get flattened into one list qw( hi hello all bye later gone ).
Perhaps you want:
my %hash = ( 'hi' => {'hello' => 'all'}, 'bye' => {'later' => 'gone'} );
See perlreftut and perlref.
|
|---|