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
Ed Avis
August 20, 2013 10:20
Re: [perl #54728] PathTools-3.27 triggers a bug in Perl
Message ID:
Dave Mitchell <davem <at>> writes:

>>But at present $1 exists in a strange halfway house where it is neither
>>truly global nor truly local.

You are right to note that $. and other punctuation variables have the
same behaviour.

I suggested that $1 should be 'localized properly' but you noted that this
might involve quite a performance penalty for every regexp match.

A simpler answer, I suggest, is that when variables like $1 and $. are passed
as arguments to subroutines, a copy be made in a read-only temporary scalar.
That would get rid of these perennial bug reports or surprises.  How about it?

Ed Avis <>

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About