On Tue, Oct 11, 2005 at 11:15:49PM +0100, Robin Houston wrote: > David Landgren wrote: > > That's because perl is trying to do the right thing with bad syntax. > > Well yes, but that's still a bug because perl ought to reject bad > syntax! The reason it isn't rejected is that pp_rv2av will happily > accept an AV on the stack, in lieu of an actual reference. That > can't be changed in general, since it's relied on. 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.)Thread Previous | Thread Next