A code snippet would be very helpful.  To pass a hash and update it,
then 
                func(\%hash);

sub func {
    my ( $hash ) = @_;
    $hash->{key} = 1;
    # this should be reflected back in the calling program when you return
 }

Wags ;)
-----Original Message-----
From: John Ross [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 19, 2002 15:09
To: [EMAIL PROTECTED]
Subject: Passing Hashes into a function


I am trying to pass an already existing hash into a subroutine, modify 
that hash, and have the modifications "take" when I leave the subroutine. 
I have looked through a number of perl books, but I either don't know what 
I am looking for, or I just don't understand how this works.  I am 
assuming that you pass the hash into the sub by reference, but from there, 
what?
When I modify the hash, the changes don't take.  I don't want to "return" 
the hash, as I don't wan't another copy.  Help!

John

-- 
John Ross 
Systems Management Integration Professional - Adv 
Data Management Solutions 
IBM
16011 College Blvd. 
Lenexa, KS  66219 
IBM Tie Line:  337-8611
Tel:  (913) 599-8611        Fax:  (913) 599-8565 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to