Re: sorting with each

2002-01-30 Thread Michael Fowler
On Tue, Jan 29, 2002 at 01:54:39PM -0800, John wrote: > Is there any way to get each to sort? In the way you mean, no. The key-value pairs returned by 'each' are sorted, they're just not sorted how you want them to be sorted :) Through Perl's tie mechanism the key-values returned by 'each' can

sorting with each

2002-01-29 Thread John
I heard each was more efficient than what appears here. Is there any way to get each to sort? foreach my $key ( sort( keys( %somehash ))) { print "$key = $somehash{$key}\n"; } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]