Rob talked about
foreach $value(sort {$a <=> $b} (values(%hash)) {
print $value;
}
vs.
foreach $value(sort byNum (values(%hash)) {
print $value;
}
sub byNum {
$a <=> $b;
}
Am I correct in thinking that the anonymous subroutine is vaguely more
efficient?
--
iain. <http://eh.org/~koschei/>
- Sorting a hash by value, and displaying the key David Michael
- Re: Sorting a hash by value, and displaying the key Brett W. McCoy
- Re: Sorting a hash by value, and displaying the key rob chanter
- Re: Sorting a hash by value, and displaying the k... iain truskett
- Re: Sorting a hash by value, and displaying t... rob chanter
- Re: Sorting a hash by value, and displaying the key Paul
- Re: Sorting a hash by value, and displaying the key Timothy Kimball
- RE: Sorting a hash by value, and displaying the key Maynard, Garth
- Re: Sorting a hash by value, and displaying the key Timothy Kimball
