"... is it simply an issue of pre-emptive maintenance coding headache prevention?"
I think so. What if you suddenly decide that the string you need to match needs to be dynamic? You forget to remove the o modifer and possibly spend a lot of time trying to find the bug when your regex stops matching. Here is some code to demonstrate:I figure why bother with such premature optimizations if they have the potential to bite.@data = qw(foo bar baz qux); { print "search: "; chomp ($in = <STDIN>); last unless $in; print $_,$/ for grep /\Q$in\E/o, @data; redo; }
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to (jeffa) 3Re: (USING POE!) Re: 'better mousetrap': how to perform timed event
by jeffa
in thread 'better mousetrap': how to perform timed event
by snafu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |