Create the hash in the global part of the program. Pass a reference to
the hash to the subroutine and manipulate that.
On Tue, 17 Apr 2001 22:37:36 +0200, [EMAIL PROTECTED] (Martijn Van Exel)
wrote:
>Hi all,
>
>I'm new to this list and quite new to Perl. I'm on digest, so I'd
>appreciate a cc.
>
>I have written a subroutine to parse a text file containing a flat file
>database. The data ends up in a hash of hashes, say %datafile. This hash is
>created on the spot, looping through the data in a foreach loop. The data
>coud then be retrieved using $datafile{$record}{$fieldname}. This seems to
>work, but the hash won't travel with me out of the subroutine. I'm not
>using strict, so I'm being messy with my declarations, probably. Do I need
>to end the subroutine using return?
>
>Any help greatly appreciated.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]