modperl and qr

[prev] [thread] [next] [Date index for 2005/01/27]

From: Arshavir Grigorian
Subject: modperl and qr
Date: 15:56 on 27 Jan 2005
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

modperl and qr
Arshavir Grigorian 15:56 on 27 Jan 2005

Re: modperl and qr
Stas Bekman 00:18 on 28 Jan 2005

Generated at 12:39 on 05 Feb 2005 by mariachi v0.52