Angharad has asked for the wisdom of the Perl Monks concerning the following question:
I then send the hashes back to the program thusfor my $key (keys %$tData) { my $value = $tData{$key}; print "overlap: $key $value\n"; }
The subroutine is called in the main program as follows:return($tData, $aData);
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.my ($tOVERLAPData, $aOVERLAPData) = getOVERLAPData($fOVERLAP);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Accessing hashes in main program from subroutine
by mickeyn (Priest) on Jan 09, 2008 at 15:58 UTC | |
by Angharad (Pilgrim) on Jan 09, 2008 at 16:23 UTC | |
|
Re: Accessing hashes in main program from subroutine
by toolic (Bishop) on Jan 09, 2008 at 15:59 UTC |