develooper Front page | perl.perl5.porters | Postings from October 2003

Re: [perl #24202] Perl 5.8.0 regexp anomaly

From:
Mario Nigrovic
Date:
October 15, 2003 00:37
Subject:
Re: [perl #24202] Perl 5.8.0 regexp anomaly
Message ID:
3F8CCF33.3050803@motorola.com
Steve -

Thanks for getting back to me on this one, but I wonder if you can point me
at a little more detail?  Searches for '@+' seem to yield blank stares...

Steve Grazzini (via RT) wrote:
> On Tue, Oct 14, 2003 at 03:42:47AM -0000, mario@anchor.sps.mot.com (via RT) wrote:
> 
>> This regex is  /^\s*(.*?)\s*(:+|%+|@+)\s*(.*?)\s*$/  and worked fine in our older version of perl (5.005).  Now, with both 5.8.0 on Solaris and 5.8.1 on Linux, there is some odd behavior.
> 
> 
> Thanks for the report, but this is actually correct behavior.
> 
> 1) @arrays are always interpolated in regexes (since 5.8.0)

This one makes sense; as I wrote, I found the docs about @foo always being
expanded.  It's what clued me in to use \@ and fix my particular problem.

> 2) @+ is a special regex variable (since 5.6.1)

I suppose this explains why the pattern matched differently between the first
and second applications, but I can't seem to find documentation about @+
anywhere, including a grep for '@\\+' and even just '@' in the regexp code.
The only thing even close is the case statement for (?@...).

What is this supposed to do and why does it function differently between the
two invocations?

Thanks for getting back to me on my initial report so quickly, but now my
curiosity is killing me...

-- Mario




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About