dragonchild has asked for the wisdom of the Perl Monks concerning the following question:
Now, I know I could just pass it the whole hashref by dereferencing it within the anonymous hashref, but I don't want to do that. (That could also clobber default values that functionCall() would give me.) What I'd love to do is tell the interpreter to create me a set of keys and values from $hashRef with the keys I give it.my $returnValue = functionCall({ A => $hashRef->{A}, B => $hashRef->{B}, Foo => 'Bar', });
Any ideas?
------
/me wants to be the brightest bulb in the chandelier!
Vote paco for President!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hash-slicing question...
by ozone (Friar) on Aug 28, 2001 at 00:34 UTC | |
|
Re: Hash-slicing question...
by clintp (Curate) on Aug 28, 2001 at 06:25 UTC | |
|
Re: Hash-slicing question...
by DBX (Pilgrim) on Aug 29, 2001 at 09:34 UTC | |
by dragonchild (Archbishop) on Aug 29, 2001 at 16:21 UTC |