in reply to Regexes and /o
The exceptional case is when you use eval
this lets you optimize and be flexible both. You can
get your $regex value as per usual, but use it
inside an eval. This can be a big win.
for ( XXX some loop ) { $patt = gen_patt( $blah); eval 'for $i ( @lines) { if ( $i =~ m/$patt/o){ process( $i); } }'; die "eval error" if $@; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Regexes and /o
by Anonymous Monk on Oct 09, 2002 at 01:05 UTC |