develooper Front page | perl.perl5.porters | Postings from December 2011

[perl #24346] pulling in stuff from outside the substr lvalue window

From:
Father Chrysostomos via RT
Date:
December 18, 2011 11:16
Subject:
[perl #24346] pulling in stuff from outside the substr lvalue window
Message ID:
rt-3.6.HEAD-14510-1324235772-1025.24346-14-0@perl.org
On Tue Dec 13 08:54:22 2011, sprout wrote:
> On Mon Dec 05 13:43:02 2011, sprout wrote:
> > On Tue Mar 09 11:42:01 2004, perl5-porters@ton.iguana.be wrote:
> > > In article <20040309154526.GB3952@e_n.org>,
> > > 	Yitzchak Scott-Thoennes <sthoenna@efn.org> writes:
> > > > Not trying to argue that it's not a bug; but you can say:
> > > > 
> > > > process(scalar substr($a, 1, 3));
> > > > 
> > > > to prevent this.  Should this be documented?  Why does it work?
> > > 
> > > It wouldn't "consume" the substr anymore, which supposedly was
> > > the point of "process".
> > > 
> > > I could argue this is a bug in "scalar" in fact...
> > 
> > Several others have argued the same thing in this ticket.  Attached is a
> > patch to fix it.  It also allows (foo(), scalar bar())=@list for lvalue
> > subroutines, which I think is good.  But it allows scalar($foo)=3, but
> > not scalar(@foo)=3.  Do we want this?  I think it is harmless and makes
> > scalar() consistent with the implicit scalar() provided by the ($)
> > prototype.
> > 
> 
> I’ve now applied it as d408447.
> 

And reverted it as 41b1a11c4.  See ticket #106288 for details.

-- 

Father Chrysostomos




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