in reply to Re: (jeffa) Re: (USING POE!) Re: 'better mousetrap': how to perform timed event
in thread 'better mousetrap': how to perform timed event
Heh heh ... thwack away! ;)
"... 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)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: (jeffa) 3Re: (USING POE!) Re: 'better mousetrap': how to perform timed event
by Anonymous Monk on Apr 24, 2003 at 08:25 UTC | |
by crenz (Priest) on Apr 24, 2003 at 08:54 UTC | |
by Anonymous Monk on Apr 24, 2003 at 09:54 UTC | |
by jeffa (Bishop) on Apr 24, 2003 at 12:55 UTC | |
by broquaint (Abbot) on Apr 24, 2003 at 10:07 UTC | |
by zengargoyle (Deacon) on Apr 24, 2003 at 09:54 UTC | |
by Anonymous Monk on Apr 24, 2003 at 20:49 UTC |
In Section
Seekers of Perl Wisdom