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.
But it's ambiguous... (Score:1)
Personally I think I'd prefer the syntax $a{foo}[] for @{ $a{foo} }; that might even be backwards-compatible. Of course, the heuristic that the parser uses to check the sigils would need completely changing, which would be a nasty job, and you lose the human-heuristic that 'if it starts with @ it's multiple-valued' which was the whole point of the multiple deref operators in the first place.
Re: (Score:1)
Good catch – if you need to dereference a ref without using a
[]or{}indexing operation, you need the@{}bracket. I guess that explains the ugly new syntax in Perl 6.I guess
${}is always necessary by the same token.All in all, not the majority of cases.