No, you're dereferencing a single element of an array reference. Dereferencing a slice from an array reference would, though.
$ cat wa sub ctx { my $w = wantarray; if( defined $w ) { print $w ? "array\n" : "scalar\n"; } else { print "void\n" } 1; } my $a = [ qw( a b c ) ]; $a->[ ctx( ) ]; @{$a}[ ctx( ) ]; $ perl wa scalar array
In reply to Re^3: Is this a bug, or expected behavior?
by Fletch
in thread Is this a bug, or expected behavior?
by fizbin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |