Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Dynamic Memory allocation

by Corion (Patriarch)
on Dec 15, 2005 at 10:25 UTC ( [id://516915]=note: print w/replies, xml ) Need Help??


in reply to Dynamic Memory allocation

How did you check that the array gets destroyed when the control leaves your function?

use strict; my %g_User; sub setup_user_details { my ($username) = @_; my @l_UserDetails = ("John","Doe"); $g_user{$username} = \@l_UserDetails; }; setup_user_details('user1');

Your naming convention is a bit unwieldly, but I attribute that to your company coding guidelines. In Perl it's conventional to use lower_caps_names instead of CamelCase, and prefixing of variables with their scope is uncommon because the strict pragma enforces proper scoping.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2024-03-28 11:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found