XP is just a number | |
PerlMonks |
Re: Re: Regex Misuseby kal (Hermit) |
on May 14, 2001 at 14:51 UTC ( [id://80178]=note: print w/replies, xml ) | Need Help?? |
I thought it was funny how he first labelled one way of doing things as a 'mistake', and then proceeded to make the 'mistake' himself: if ($text =~ m/\.txt$/) Why not use substr ($text, -4, 4); to extract the .txt, and then eq to compare it? The reason is, of course, that we write code for readability, not efficiency, for the most part. See "obfuscation" :)
In Section
Meditations
|
|