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);
In reply to Re: regex "o" modifier
by nite_man
in thread regex "o" modifier
by shemp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |