What's wrong with the simple solution?
my @sorted; if ($joe eq "numbers") { @sorted = sort { $hoh{$a}->{value} <=> $hoh{$b}->{value} } keys %hoa; } else { @sorted = sort { $hoh{$a}->{value} cmp $hoh{$b}->{value} } keys %hoa } foreach $key ( @sorted ) { blah; }
In reply to Re: Specify sort method on the fly
by BrowserUk
in thread Specify sort method on the fly
by rethaew
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |