in reply to Re: Confused about typeglobs and references
in thread Confused about typeglobs and references
Beware *a and *b, you're treading near $a and $b, which are sacred to sort.
I think that's a little misleading. $a and $b are used by sort, but otherwise are not special to sort.
Here's the deal:
$a and $b are pre-declared package variables.
That means you can use them -- without declaring them first -- even under strict.
Of course, as with all global variables, safe programming means localizing.
So if there's any chance that you've been called from within a sort (unlikely), localize $a and $b before touching them. And if there's any chance that you will call sort while working with $a or $b, be sure to localize them before passing control to where the sort might happen.
|
|---|