Just to clarify. Parens immediately after a function are taken as delimiters for the argument list (as you rightly explained) --- but that has nothing to do with Perl's prototypes:
sub foo { # no prototype here return ('a','b','c'); } # print (foo)[0]; # same error print +(foo)[0];
I also show the unary + op as a better generalization of your last example --- it disambiguates without imposing numeric context.
In reply to Re: Re: Accessing Arrays and Lists
by danger
in thread Accessing Arrays and Lists
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |