Re: Passing Hashes into a function

2002-08-20 Thread david
John Ross wrote: > Thank you to all of you who responded to my question about pasing hashes > into a function. The -> operator did the trick. > My problem was that I thought once I passed the hash in, I could > dereference it That doesn't appear to work like I expected. > > sub mod_hash { >

Re: Passing Hashes into a function

2002-08-20 Thread John Ross
Thank you to all of you who responded to my question about pasing hashes into a function. The -> operator did the trick. My problem was that I thought once I passed the hash in, I could dereference it That doesn't appear to work like I expected. sub mod_hash { my $hash_ref = @_; my

Re: Passing Hashes into a function

2002-08-19 Thread drieux
On Monday, August 19, 2002, at 03:08 , John Ross wrote: > 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

Re: Passing Hashes into a function

2002-08-19 Thread John W. Krahn
John Ross wrote: > > 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 t

RE: Passing Hashes into a function

2002-08-19 Thread David . Wagner
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 Ros