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 reply to Re: Re: Regex Misuse
by kal
in thread Regex Misuse
by srawls
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |