<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).
In reply to Re: Re: Grabbing file prefixes with Reg Exp
by dws
in thread Grabbing file prefixes with Reg Exp
by nysus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |