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 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?
you will want to go over the
perldoc perlref
then go back over:
>
> On Monday, August 19, 2002, at 03:16 , [EMAIL PROTECTED]
> wrote:
>
> 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 ;)
since the trick there is to 'get' that we move from using the
%hash -
to
$ref_oh_hash
notation...
ciao
drieux
---
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]