in reply to Re: Send hash of hash arguments to sub
in thread Send hash of hash arguments to sub
Another possibility is:
my %hash = (Mary => { Maria => 0.8}, other_keys => "other_values"); sub probability (\%$$) { my ($hash_ref, $source, $target) = @_; return $hash_ref->{$source}{$target}; } my $test = probability(%hash, "Mary", "Maria"); print "$test\n";
|
|---|