Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^4: Why doesn't Perl provide %_ as the hash equivalent of @_ in subs?

by ikegami (Patriarch)
on Sep 26, 2013 at 14:16 UTC ( [id://1055843]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Why doesn't Perl provide %_ as the hash equivalent of @_ in subs?
in thread Why doesn't Perl provide %_ as the hash equivalent of @_ in subs?

It's possible to alias hash values.
$ perl -MData::Alias -E' @_ = ( a=>4 ); alias %_ = @_; $_[1]=5; say $_{a}; $_{a}=6; say $_[1]; ' 5 6

However, copying args is a good thing. That's why we don't access @_ directly.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1055843]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-20 03:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found