develooper Front page | perl.perl5.porters | Postings from August 2013

Re: [perl #54728] PathTools-3.27 triggers a bug in Perl

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
August 6, 2013 11:24
Subject:
Re: [perl #54728] PathTools-3.27 triggers a bug in Perl
Message ID:
20130806112404.GE2177@iabyn.com
On Mon, Aug 05, 2013 at 08:42:48AM -0700, Victor Efimov via RT wrote:
> On Mon Aug 05 03:51:38 2013, davem wrote:
> > On Sun, Aug 04, 2013 at 04:28:32PM -0700, Victor Efimov via RT wrote:
> > > So, it looks like a bug to me.
> > > 
> > > 1) two explanation above, with aliasing and localized global vars does
> > > not apply for real localized glabal vars.
> > 
> > Except that $1 etc are *not* localised. The thing that is localised is the
> > current match (PL_curpm internally). $1 et al are just magic vars that
> > retrieve values from the current match on request.
> > 
> > 
> 
> Isn't it unclearly documented? 

Quite possibly

> (both cases declared as "dynamically-scoped")

That's because they're both dynamically (as opposed to lexically) scoped.

> Also, isn't this a misfeature?

I don't see why.
> 
> Seems we're going drop things like empty regexps
> https://rt.perl.org/rt3/Ticket/Display.html?id=119095 (although it is
> documented). And this issue much more useless and unclear imho.

If we were to set every capture var ($1,$2,...) on every match, rather than
just on demand, regexes would be an awful lot slower.

-- 
Never work with children, animals, or actors.

Thread Previous | Thread Next


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