You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Arshavir Grigorian <ag...@m-cam.com> on 2005/01/27 16:56:22 UTC
modperl and qr
Hello list,
The qr example in the guide does not work as expected. Using the /o in
the foreach loop matches based on the first value of $re and never
changes even when $re is recompiled.
The /o modifier should be removed since that's exactly what we are
trying to avoid.
http://perl.apache.org/docs/general/perl_reference/perl_reference.html#Compiled_Regular_Expressions
my $pat = '^foo$';
my $re = qr($pat);
foreach( @list ) {
print if /$re/o;
}
Arshavir
Re: modperl and qr
Posted by Stas Bekman <st...@stason.org>.
Arshavir Grigorian wrote:
> Hello list,
>
> The qr example in the guide does not work as expected. Using the /o in
> the foreach loop matches based on the first value of $re and never
> changes even when $re is recompiled.
> The /o modifier should be removed since that's exactly what we are
> trying to avoid.
>
> http://perl.apache.org/docs/general/perl_reference/perl_reference.html#Compiled_Regular_Expressions
>
>
> my $pat = '^foo$';
> my $re = qr($pat);
> foreach( @list ) {
> print if /$re/o;
> }
Good catch, Arshavir. Committed.
--
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com