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

From:
Robin Houston
Date:
October 12, 2005 10:53
Subject:
Re: [PATCH] Re: [perl #37350] $#{@$aref} in debugger gives: Bizarre copy of ARRAY in leave
Message ID:
20051012171237.GA16869@rpc142.cs.man.ac.uk
> I think the problem is that that the first executed (of two) rv2av
> is getting the OPf_REF flag set, when IMO it shouldn't.  $#{@x} *is*
> valid syntax; it should return $# of the array symbolically referred
> to by @x, like this:
> 
> $ perl -we'*1 = [qw/foo bar baz/]; @x=0; print $#{0+@x}'
> 2
> 
> only without the 0+ being there.  (If @x is lexical, then it's padav
> that has the troublesome OPf_REF.)

How true! Great, thanks. (I'm not sure whether to be sorry that I
posted something so wrong, or pleased that I got the ball rolling.)

Even if we do nothing else, we should surely apply Dave Mitchell's
suggestion which fixes this case. But of course a better fix would
be better.

Robin



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