Hi!
Thanks for all your help. It was really really useful.
I'm almost done with the program I'm writing, but I ran into one
complication:
I have this hash array with list of list references:
an example of the variable type I'm dealing with:
$master{key} = [ ["a","b","c"], ["d","e","f"], ["g","h","i"] ];
to access element 1,2: $master{key}->[1][2] # that is "f"
Here is the problem:
my program takes in the %master hash array, changes the info inside, and
prints all the matricies.
I want to test if anything was changed in %master.
I don't think I can do a straight forward copy %store = %master. Why?
Because I'm using references to arrays, not actual arrays. So the values
in %store point to the same things as %master. If %master changes, so
does %store.
But, then again, when I try the %store = %master thing in my program:
for (1..$times) {
%orig = %master; # master changes each time the
# for loop is executed (sometimes)
print "processing time number $_\n";
process();
%new = %master;
if (%new != %orig) { print "***changed\n"; }
}
It never says "***changed", I think because I am using refs.
Any ideas?
Thanks.
- Adam Stern