More Hash problems
jasona at inetarena.com
Wed Jun 5 15:39:36 CDT 2002
I'm having some trouble with the contents of my hash changing.
I start with a numerically keyed list of arrays. The first element of each array is a name.
The goal is to have one hash of rules indexable by integer keys and another indexable by name.
Here is my code:
my (%rules) = blah blah blah; #Works and indexes fine
Now %RULES Works and indexes fine with the names as keys but the first element of my arrays are gone in the first hash.
I also tried adding %TmpHash=%rules and then parsing the %TmpHash, but it still affected %rules.
When I say $a=$b am I just setting a pointer? How can I actually copy the values?
is ($key,$value)=each(%rules) effectivly popping my first element?
should I switch to a foreach keys syntax?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pdx-pm-list