you place a \ in front of what you are doing, so it becomes

        &foo(\%bar);
No real need to return, since any updates you would do, automatcially upd
the hash. Within the sub foo you would have somehting like:
        my ( $bar ) = @_;

        To access using a key:
                $bar->{'key'} or could be a variable
                $bar->{$mykey}

Wags ;)

-----Original Message-----
From: Nic LAWRENCE [mailto:[EMAIL PROTECTED]]
Sent: Sunday, June 03, 2001 14:27
To: [EMAIL PROTECTED]
Subject: passing hashes between subroutines


Is it possible to pass hashes between subroutines? When I try stuff like
&foo(%bar); or return %bar; it doesn't seem to work how I would expect.
:-/

Nic LAWRENCE <[EMAIL PROTECTED]> Technical Director
TFBnet Internet Services   http://www.niclawrence.co.uk
eFax US: +1 (253)295-8297   eFax UK: +44 (0)870 124-8724
Statements made are at all times subject to TFBnet's Terms and
Conditions of Business, which are available upon request.

Reply via email to