in reply to regex "o" modifier
In this case, regexp will be recompiled for each iteration of extern loop, which changes our regexp. But the regexp will not recompile every time into internal loop. It will serve.for my $day_week( qw(Mon Tue Wed Thu Fri Sat Sun) ) { my $regexp = "^$day_week"; eval 'for my $day (qw (Mon Mon Wed Fri Sat Sun Fri Wed Tue Wed) ) +{ if($day =~ m/$regexp/o) { # do somthing } }'; }
--------------------------------
SV* sv_bless(SV* sv, HV* stash);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regex "o" modifier (use qr//)
by Aristotle (Chancellor) on May 07, 2003 at 07:46 UTC |