Re: sort hash with an array as the value

2010-05-11 Thread Shlomi Fish
Hi Owen, On Tuesday 11 May 2010 14:10:49 Owen wrote: > I have this statement; > > foreach my $key ( keys %filehash ) { > print "$key $filehash{$key}->[0]\t\t\t$filehash{$key}->[3]\t > $filehash{$key}->[2]\t $filehash{$key}->[1]\n"; > } > > but wish to sort the output by $filehash{$key}->[0].

AW: sort hash with an array as the value

2010-05-11 Thread Thomas Bätzler
Owen asked: > I have this statement; > > foreach my $key ( keys %filehash ) { > print "$key $filehash{$key}->[0]\t\t\t$filehash{$key}->[3]\t > $filehash{$key}->[2]\t $filehash{$key}->[1]\n"; > } > > but wish to sort the output by $filehash{$key}->[0]. Is it possible? > How do I do this? for

sort hash with an array as the value

2010-05-11 Thread Owen
I have this statement; foreach my $key ( keys %filehash ) { print "$key $filehash{$key}->[0]\t\t\t$filehash{$key}->[3]\t $filehash{$key}->[2]\t $filehash{$key}->[1]\n"; } but wish to sort the output by $filehash{$key}->[0]. Is it possible? How do I do this? I can't make a separate hash of t