If you are referring to How can I use a reference as a hash key?, I don't see your point.
Inside an anonymous hash or in a 'flat' list, a hash reference (or any reference) will just get stringized away if you try to use it as a hash key (unless you invoke some other magic).
>perl -wMstrict -le
"sub func {
my %args = @_;
print keys %args
}
func({ bar => 'baz' } => 'foo');
func({ fee => 'fie' } , 'foe');
"
HASH(0x225398)
HASH(0x225398)
| [reply] [Watch: Dir/Any] [d/l] |
Which is kinda useless if you're trying to pass this reference into a function.
| [reply] [Watch: Dir/Any] |
>perl -wMstrict -MData::Dumper -le
"sub func {
my %args = %{ $_[0] };
print Dumper \%args;
print $args{foo}->{bar};
}
func({ foo => { bar => 'baz' } });
"
$VAR1 = {
'foo' => {
'bar' => 'baz'
}
};
baz
| [reply] [Watch: Dir/Any] [d/l] |
| [reply] [Watch: Dir/Any] [d/l] |
But surely the point is that if you pass a reference (to whatever, and however generated) as the value of a named parameter in the func({ foo => [ 1, 2 ] }); scheme, then there is no problem whatever.
| [reply] [Watch: Dir/Any] [d/l] |