develooper Front page | perl.perl5.porters | Postings from October 2005

Re: [PATCH] Re: [perl #37350] $#{@$aref} in debugger gives: Bizarre copy of ARRAY in leave

Thread Previous | Thread Next
From:
Robin Houston
Date:
October 14, 2005 16:21
Subject:
Re: [PATCH] Re: [perl #37350] $#{@$aref} in debugger gives: Bizarre copy of ARRAY in leave
Message ID:
20051014222703.GC27883@rpc142.cs.man.ac.uk
On Fri, Oct 14, 2005 at 10:20:29PM +0200, David Landgren wrote:
> Does this by chance also happen to make
> 
>   push @{$_ % 2 ? @odd : @even} for 0..10
> 
> happen to work as well, or are other forces coming into play?

Assuming you really meant:

  push @{$_ % 2 ? @odd : @even}, $_ for 0..10

it "works" in the sense that it's equivalent to

  @0 = (0..10);

which presumably isn't what you meant. This:

  push @{$_ % 2 ? \@odd : \@even}, $_ for 0..10;

does what I guess you want, but that hasn't changed.

Robin

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