Obviously this code fails, but you can see what I am trying do to. I couldn't find anything like this searching the archives here. Thanks for your help.if ($joe eq "numbers") {my $sortype='<=>';} if ($joe eq "letters") {my $sortype='cmp';} #then go on to work on the hash foreach $key (sort { $hoh{$a}->{value} $sortype $hoh{$b}->{value} } ke +ys %hoa) { blah; }
In reply to Specify sort method on the fly by rethaew
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |