FWIW, using $a and $b outside of sort is always a mistake
The special variables $a and $b are also used
by List::Util's reduce function and by List::MoreUtils's
pairwise function.
| [reply] [d/l] [select] |
For a grasshopper, just fresh out of the egg, and not really having a license yet to come anywhere near a keyboard, this is decent advice. It's the level of advice you give to a toddler who's about to start crawling. "Hot, don't touch".
Anyone who has half a braincell he can fire up once a blue moon, however, will see how silly that is.
A lot of code doesn't sort. Most code that does sort, doesn't even use the variant that makes Perl stuff $a and $b. And even if you do, even then you have to work hard to make a use of $a and $b make things mess up.
If you really need to have a Pavlov reaction when you see an $a and/or a $b, and blind yourself from the fact a poster may have used well known example variable names, please keep your urges private, and don't hit that "create" button. It doesn't add any value. | [reply] [d/l] [select] |