Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Passing a hash between subs

by Coruscate (Sexton)
on Jan 30, 2003 at 16:58 UTC ( [id://231379]=note: print w/replies, xml ) Need Help??


in reply to Passing a hash between subs

I know that this may not help you with the problem you've posted, but it is something that can become important. Then I'll nitpick one smaller thing.

Your last line of the bar() sub is return %locations, so you are copying the data structure over to the foo() sub. This might take up a few extra cycles if the hash is quite large, so you might want to consider passing by reference instead. Change that last bar() line to return \%locations;, that first line of foo() to my $locations = bar($dbh);, and then dereference $locations to get at the values. My little nitpick is getting rid of the '&' symbol that is part of your call to foo(). Nasty, nasty, nasty (:


      C:\>shutdown -s
      >> Could not shut down computer:
      >> Microsoft is logged in remotely.
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-20 01:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found