Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: How Do I pass a hash to a subroutine?

by thephpguy (Initiate)
on May 06, 2011 at 18:06 UTC ( [id://903428]=note: print w/replies, xml ) Need Help??


in reply to How Do I pass a hash to a subroutine?

MeowChow's code for passing by reference is VERY inefficient unless you actually want a copy of the Hash. (Why pass by ref if you want a copy?)
mysub(\%hash); sub mysub { my $paramhash = $_[0]; }
With the above code any modification will affect the original hash.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2026-01-18 16:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (122 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.