go ahead... be a heretic | |
PerlMonks |
Re^5: Golf: reverse sort /etc/passwd by UIDby Tommy (Chaplain) |
on Feb 05, 2013 at 20:53 UTC ( [id://1017283]=note: print w/replies, xml ) | Need Help?? |
Noted. Re-reading perldoc -f sort reveals that the sort of "magic" I thought I was seeing wasn't the case. $a and $b are package globals explicitly passed by Perl itself to the sort block (or subroutine of your definition). It's not a bare leftside-rightside comparison of whatever expressions you may provide. You have to explicitly use the $a and $b package global symbols, and $_ isn't $a/$b. Them's the rules. I do indeed stand corrected.
Tommy A mistake can be valuable or costly, depending on how faithfully you pursue correction
In Section
Meditations
|
|