XP is just a number | |
PerlMonks |
Re^2: Sorting Hash / Arrayby sauoq (Abbot) |
on May 16, 2012 at 18:23 UTC ( [id://970885]=note: print w/replies, xml ) | Need Help?? |
I'd rather see that sort routine inlined in this case. As it stands, nasty subtle bugs can creep in with some sloppy maintenance. Say at some point someone has to add $VAR2 and perform similar sorting on it... and make the all too simple mistake of thinking they can add a line that reads: Oops. And that's just one example. This is perfectly readable:
If it was something you had to do repeatedly, it would be better to wrap the whole sort in a sub...
-sauoq "My two cents aren't worth a dime.";
In Section
Seekers of Perl Wisdom
|
|