![]() |
|
Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Condensing a grep into a sortby Roy Johnson (Monsignor) |
on Jun 09, 2009 at 17:26 UTC ( #770019=note: print w/replies, xml ) | Need Help?? |
It is not reasonable to have a sort that excludes members of the list entirely. Sort rearranges lists; grep filters them.
What you might want to do is a Schwartzian Transform so that the regex doesn't need to be applied to $a and $b repeatedly. Hoping for partial credit, I eliminated the join. Caution: Contents may have been coded under pressure.
In Section
Seekers of Perl Wisdom
|
|