in reply to Named Sort Subs with Strict?
When dealing with Perl scoping issues, try to think less about how Perl might "see" the variables and think about where the variables are physically placed in the source code.sub do_msalist { my (%country, %state, %msaname, @msakeys); sub by_americentric { $country{$b} cmp $country{$a} or $state{$a} cmp $state{$b} or $msaname{$a} cmp $msaname{$b} or $a <=> $b } foreach (sort by_americentric @msakeys) { ... } }
|
|---|