in reply to Re: Regex Misuse
in thread Regex Misuse
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" :)