in reply to Confused about typeglobs and references
You're doing something right, using strict to catch unintended global variables. You can say:
use vars qw( @a @b ); # or else for recent perl # our (@a, @b);
Beware *a and *b, you're treading near $a and $b, which are sacred to sort. Expect bizarre bugs in code that uses those names. Your example function is probably ok since it doesnt call sort and localizes the typeglob, but imagine what could happen if some function that sorts were called, and a user fed the function a pair of refs to scalars. It would compile, appear to work, and might even return correct values - for most inputs.
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Confused about typeglobs and references
by jdporter (Paladin) on Nov 04, 2002 at 21:57 UTC | |
|
Re: Re: Confused about typeglobs and references
by Argel (Prior) on Nov 04, 2002 at 20:18 UTC |