in reply to Re: array/hash - reference and dereference
in thread array/hash - reference and dereference
My idea is: When the script start, I don't have the hash values. So,I want to create "pointer" points to the hash. And "save" the specific hash value into an array. Later, when the hash values are fetched, I can just run:%ages = ('Martin' => 0, 'Sharon' => 0, 'Rikke' => 0); #this way? @insert = \%hash; #at this point, what is the correct way to save the hash into an array +? $insert[0] = $ages->{‘Sharon’}; $insert[1]=$ages->{'Martin’}; %ages = ('Martin' => 28, 'Sharon' => 35, 'Rikke' => 29); : : $sqlquery -> execute(@insert);
Please advise. Thanks.$sqlquery -> execute(@insert);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: array/hash - reference and dereference
by fullermd (Vicar) on Jan 09, 2009 at 04:45 UTC | |
|
Re^3: array/hash - reference and dereference
by Anonymous Monk on Jan 09, 2009 at 03:39 UTC |