XP is just a number | |
PerlMonks |
Dynamic Memory allocationby needperlhelp (Acolyte) |
on Dec 15, 2005 at 10:16 UTC ( [id://516909]=perlquestion: print w/replies, xml ) | Need Help?? |
needperlhelp has asked for the wisdom of the Perl Monks concerning the following question:
I have an global associative array %g_User; with keys as userids for each user i want to dynamically create an array and attach its refrence to the value of the associative array as shown below $g_User{'user1'} = \@l_UserDetails; but i face the following problem; > if dont declare the array @l_UserDetails, the variable is global and all users refer to the same array > if i delare array with my / local , they will get destroyed when the control comes out of the function in which the addition happens do we have something simillar to new / malloc in perl or is there a simpler way to handle this situation in perl please help
Back to
Seekers of Perl Wisdom
|
|