http://qs321.pair.com?node_id=785819

Manchego has asked for the wisdom of the Perl Monks concerning the following question:

use Data::Dumper; { # This Makes sense: my @b; my @a=$b[0]; print Dumper(\@a); # $VAR1 = [ undef ]; } { # So does this: my @a = []->[0]; print Dumper(\@a); # $VAR1 = [ undef ]; } { # But this makes no sense (and seems like bug): my @a = ()[0]; print Dumper(\@a); # $VAR1 = [] }
Why should that last one return an empty list? I would expect an array of size 1 like the first 2 cases. Can someone please help shed some light on this? Thanks!