develooper Front page | perl.perl5.porters | Postings from April 2006

[perl #3112] RE: pushing last on an array results in bizarre copy (was: Bizarre copy of ARRAY in last)

From:
Animator via RT
Date:
April 27, 2006 11:14
Subject:
[perl #3112] RE: pushing last on an array results in bizarre copy (was: Bizarre copy of ARRAY in last)
Message ID:
rt-3.0.11-3112-132782.3.11318068039796@perl.org
> [Peter@PSDT.com - Sun Apr 16 10:54:31 2000]:
> 
> for (1..4) {
>    push @a, $_, last if $_ == 3;
> }
> print "@a\n";
> __END__
> Bizarre copy of ARRAY in last at - line 1.
> 

A somewhat shorter version of this problem: perl -le 'for (1) { push @a, last; }'

(If in the initial problem parans are used around push then the error goes away ( push (@a, $_), last ... )

This problem still exists in bleadperl (and 5.8.8, and 5.9.3)...


Regards,

Animator



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