NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Eenhhhhh. (Score:1)
I don’t see why we’re being forced to write the outer deref. It could be much simpler:
Much nicer than autoboxing, too.
There’s never any more or less of a guarantee that
$hash->{key}will be an array-ref anyway, regardless of which way you write it. There's never any ambiguity there either. The current rule is just arbitrary outgrowth of the prototype brain damage. A better way to approach the problem that prototypes attack would have been to provide a prefix notation for binary operators and then declarepushet al an operator.I had hoped that autoboxing would at least give me something close to that by means of indirect object syntax:
push $hash->{key} 42; # note the missing commaHowever, no dice. I can find no way to convince Perl to parse something that starts out like a plain
pushinvocation as an indirect object method call instead. It always complains that something is wrong before it gets to the end of the expression.Reply to This
Re: (Score:2)