Re: Passing hashes by reference.
From: ./Rob & (invalid_at_invalid.net)
Date: 09/30/04
- Previous message: Gunnar Hjalmarsson: "Re: (when) is the ; required?"
- In reply to: krf: "Passing hashes by reference."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 30 Sep 2004 00:06:10 -0400
"krf" <krf@Vega.com> wrote in message
news:pan.2004.09.30.00.31.10.861598@Vega.com...
> If I call a perl module with a hash variable, like so...
>
> pass1(\%myhash);
>
> The hash shows up in $_[0] and the debugger thinks it is a hash.
>
> I can even use $_[0] as a hash over in the module.
> Still normal so far.
>
> But if I do %anotherhash = $_[0], I get an undef in %anotherhash.
>
> Insights anyone??
>
> krf
I think you need to do:
%$anotherhash = shift;
or $foo = shift;
%anotherhash = %$foo;
- Previous message: Gunnar Hjalmarsson: "Re: (when) is the ; required?"
- In reply to: krf: "Passing hashes by reference."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|