perl -e '$x = ($u=undef)->{foo}'
Can't use an undefined value as a HASH reference at -e line 1.
while this is (of course) fine:
perl -e '$u = undef; $x = $u->{foo}'
isn't the result of an assignment supposed to be a proper lvalue ?
perldoc perlref definitely discusses autovivication in terms of
lvalues, so this feels like a bug to me.
I think it's a bug. I think it's probably bug 18635, or at least related
to this bug.
Rafael summarised the thread that I'm thinking about here:
http://dev.perl.org/perl5/list-summaries/2002/p5p-200211-4.html
xray threads better than that summary's link, and Rafael's summary table is
here:
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2002-11/msg00855.html
I've not had the tuits TODO it yet :-(
Nicholas Clark
This is without "use strict" at all though, so it looks different to me.
I'll perlbug it so it at least doesn't get lost.