I have a script that contains a subroutine that takes a file, does some analysis, reads the results into two separate hashes and then returns the hashes to the main program. Or so I thought.
When I do this in the subroutine just before sending the hashes back to the main program, it prints out the contents correctly
for my $key (keys %$tData)
{
my $value = $tData{$key};
print "overlap: $key $value\n";
}
I then send the hashes back to the program thus
return($tData, $aData);
The subroutine is called in the main program as follows:
my ($tOVERLAPData, $aOVERLAPData) = getOVERLAPData($fOVERLAP);
And then try to print out the contents of the same hashes within the same program but it seems that the hashes aren't being returned as I'm not getting any print out of the content.
Can anyone suggest why this might be so? I know i haven't given you much code but I'm assuming I've just done something rather silly as returning a hash should be a trivial process should it not? The hashes DO exist in the subroutine and i can print out the contents just fine - I just can't get to them in the main program.