in reply to Re: Grabbing file prefixes with Reg Exp
in thread Grabbing file prefixes with Reg Exp
<counteropinion>
Unless the regexp is going to be in a performance-sensitive area of code, the performance gained by using character classes instead of /i is going to be outweighed by the readability hit.
To my eye, it's easier (albeit only slightly so) to grasp the intent of my @files = map s/\.ram$//i ? $_ : (), readdir DH; than it is to grasp my @files = map s/\.[Rr][Aa][Mm]$// ? $_ : (), readdir DH; When hardware performance isn't an issue, optimize for wetware (readability).
|
|---|