in reply to Re: make a hash globally accessible
in thread make a hash globally accessible
That said, you're very close. Assigning the results of the ProcessSegmentxxx call to %seg000 would work -- if you actually returned the hash from the subroutine. Likewise, passing a reference to the hash would work -- if you actually used the reference in the subroutine to hold data.
The code to do that would be similar to:
Note the dereferencing arrow.sub ProcessSegment000 { my $dataline = shift; my $seg000 = shift; $seg000->{fileid} = substr($dataline,0,3); # et cetera
Seriously though, I shudder to think at the kind of work you mihgt have to do to update all of those similar subs. That'll be the next thing to tackle, right?
|
|---|