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

[perl #119797] lvalue sub shows "Bizarre copy of ARRAY in block exit" in very specific case.

Thread Previous | Thread Next
From:
James E Keenan via RT
Date:
September 15, 2013 16:10
Subject:
[perl #119797] lvalue sub shows "Bizarre copy of ARRAY in block exit" in very specific case.
Message ID:
rt-3.6.HEAD-1873-1379261435-1502.119797-15-0@perl.org
On Sun Sep 15 07:10:48 2013, sprout wrote:
> On Sun Sep 15 06:21:00 2013, jkeenan wrote:
> > ##########
> > $ cat 119797-lvalue.pl 
> > my @this = (1..5);
> > 
> > (that()) = ();
> > print "@this\n";
> > 
> > sub that :lvalue { if (@this) { } else { @this; } }
> > ##########
> > $ perl 119797-lvalue.pl 
> > 1 2 3 4 5
> > ##########
> > 
> > I don't think there is a bug here.
> 
> Your version puts something in the array, avoiding the else block.
> 
> Try this:
> 
> #!perl
> my @this = ();
> 
> (that()) = ();
> print "@this\n";
> 
> sub that :lvalue { if (@this) { } else { @this; } }
> __END__
> 
> That gives me a bizarre copy.
> 


Okay.  So now we should ask:  How significant is this bug?  What can we
do to fix it?

Thank you very much.
Jim Keenan

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=119797

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