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

[ID 20000416.002] Bizarre copy of ARRAY in last

Thread Next
From:
Peter Scott
Date:
April 16, 2000 17:54
Subject:
[ID 20000416.002] Bizarre copy of ARRAY in last
Message ID:
4.2.2.20000416172236.00a4f9c0@mail.psdt.com
for (1..4) {
   push @a, $_, last if $_ == 3;
}
print "@a\n";
__END__
Bizarre copy of ARRAY in last at - line 1.

The behavior is the same in Perl 5.005_04, 5.005_03, and 5.6.0.  Of course 
the user is wrong but why miss an opportunity to tell them so in more 
florid terms? :-)




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