Hi, I am writing a script that initializes a %HoHoH while iterating through several 
items.  This works correctly, and also retrieving the keys/values works correctly.  I 
then call a subroutine that retrieves data and is SUPPOSED to update that same hash 
with the results.  Unfortunately, when I get to the end of the program, the original 
data which I initialized it with is still there.

I am quite sure it is probably a ref/deref problem, but have read every 
perlref/prelreftut example I could fine and no luck!

Example:

# Main 
my $Results;

# Initialized with 3 for every value
# $Results{ $cty }{ $dom }{ $eng } = "3";

 foreach my $cty ( @Cities ) {
        foreach my $dom ( @Domains ) {
            my @Engines = ( sort keys %Engine_Urls );
            foreach my $eng ( @Engines ) {
                $Results{ $cty }{ $dom }{ $eng } = "3";
                my @out = ( $cty, $dom, $eng );
                &SomeSub( \@out );
            }
        }
}               



sub SomeSub {
        my ($refdata) = @_;
        my ($cty, $dom, $eng) = @{$refdata};
        .....
                (modify some data)
        .....   
        $Results{ $cty }{ $dom }{ $eng } = $newdata;
}

well, when I get the keys/values at the end of the program, they are still from the 
original hash creation.  Ie, they all still equal "3"!

Anything simple I am missing?

BTW:  I am also using threads with the Thread::Pool, Thread::Use, and LWP::UserAgent 
modules.

Thanks,

Greg

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to