On Mar 20, 2009, at 11:19 AM, Jonathan Yu via RT wrote:
Show quoted text
It is in there. Look down in the examples.
Show quoted text> I thought that the $a and $b only come into play when you are
> creating a comparison function, as:
>
> sub cmpthese { $a <= $b }; # so $a and $b are global variables
It it true that $a and $b are typically used with the comparison
operators
(e.g. cmp, <=>) But they are package variables that are already declared
and Perl magically assign values to them whenever you use sort().
You shouldn't assign to them unless you're trying to do something very
clever in a sort() operation. Using $a and $b as variable names in any
other context is confusing and may lead to bugs. Besides, they are
just poor variable names.
Show quoted text> Anyway, it would be helpful in the future if the offending variable
> name is printed out, if possible?
That's a great suggestion! It will be in the next release.
Show quoted text> Thanks for a great module!
It is our pleasure. Thank you for using it :)