spudzeppelin has asked for the wisdom of the Perl Monks concerning the following question:
I have a module (yes, mod_perl) I'm constructing where I have the obligatory use strict; at the beginning, but now it is causing me grief further down. Excerpts follow:
sub do_msalist { my (%country, %state, %msaname, @msakeys); ... foreach(sort by_americentric @msakeys) { ... } } #do_msalist sub by_americentric { $country{$b} cmp $country{$a} or $state{$a} cmp $state{$b} or $msaname{$a} cmp $msaname{$b} or $a <=> $b } #by_americentric
So now, the problem I'm encountering is that the use of strict is throwing a compile-time error with the package name of the hashes in the sort subroutine -- I've checked Camel2, Panther, and Hall, and none of them cover this particular dilemma in their treatment of sort.... What are your thoughts?
Spud Zeppelin * spud@spudzeppelin.com
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Named Sort Subs with Strict?
by Fastolfe (Vicar) on Sep 19, 2000 at 21:47 UTC | |
|
Re: Named Sort Subs with Strict?
by stephen (Priest) on Sep 19, 2000 at 21:50 UTC | |
|
Re: Named Sort Subs with Strict?
by chromatic (Archbishop) on Sep 19, 2000 at 21:45 UTC | |
|
Re: Named Sort Subs with Strict?
by merlyn (Sage) on Sep 19, 2000 at 21:28 UTC | |
|
Re: Named Sort Subs with Strict?
by runrig (Abbot) on Sep 20, 2000 at 00:39 UTC | |
|
RE: Named Sort Subs with Strict?
by spudzeppelin (Pilgrim) on Sep 19, 2000 at 23:16 UTC | |
by Fastolfe (Vicar) on Sep 20, 2000 at 00:17 UTC |