in reply to Re: Sorting hash keys according to different criteria
in thread Sorting hash keys according to different criteria
Hi, Can I ask why this only prints one item in the hash array?
my %people; %people =( { name => "fred", age => 31, }, { name => "bill", age => 32, }); my $length = keys %people ; print "$length\n"; foreach my $key (sort keys %people) { print("$people{$key}{'name'}: $people{$key}{'age'}\n"); }
Code tags - dvergin 2003-06-24
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Sorting hash keys according to different criteria
by George_Sherston (Vicar) on Jun 24, 2003 at 21:46 UTC |
In Section
Seekers of Perl Wisdom