Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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

by ikegami (Pope)
on Sep 26, 2013 at 14:16 UTC ( #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.


Comment on Re^4: Why doesn't Perl provide %_ as the hash equivalent of @_ in subs?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2014-08-20 11:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (111 votes), past polls