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";
}
Last edited by laurel; 12-23-2014 at 06:05 PM.
|