sorting in perl
I want to convert code1 to code2 but I couldn't sort
<CODE1> foreach my $str(sort keys %count) { print Output "$str $count{$str}\n"; } <CODE2> while (my $str = each %count){ } continue{ print Output "$str $count{$str}\n"; } |
have you tried:
while (my $str = each sort keys %count) ?? |
All times are GMT -5. The time now is 03:31 AM. |