On Wed, Jul 3, 2013 at 11:02 AM, David Golden <xdg@xdg.me> wrote: > On Wed, Jul 3, 2013 at 10:23 AM, Dave Mitchell <davem@iabyn.com> wrote: > > expr->[] > > $a->[1,5,7] > > This is even more attractive to me when considered together with > normal element access: > > $array->[]; # dereference > $array->[$i]; # single element > $array->[@list]; # array slice > > $hash->{}; # dereference > $hash->{$n}; # single element > $hash->{@list}; # hash slice > What's the output of sub f { say wantarray || 0 } $array->[ f() ] $hash->{ f() } Right now, it's 0 0, so the following aren't backwards compatible: $array->[@list] $hash->{@list} It bugs me slightly that [] and {} look "empty" when in fact they > return everything Is ->[*] available?Thread Previous | Thread Next