Keep It Simple, Stupid | |
PerlMonks |
Re: Regular expressions and sortby Aristotle (Chancellor) |
on Nov 04, 2005 at 14:11 UTC ( [id://505701]=note: print w/replies, xml ) | Need Help?? |
You should always, always either combine capturing patterns with conditionals or use list assignment to pull out captures. In your case, that means I’d write the routine in either of these ways:
Never use $1 when you’re not checking for a pattern match’s success. Makeshifts last the longest.
In Section
Seekers of Perl Wisdom
|
|