return map $_->{'value'}, @{%$hash}{@_};
^
####
#!/usr/local/bin/perl -w
use strict;
sub xget {
my $hash = shift;
return map $_->{'value'}, @{%$hash}{@_};
}
my $hash = {
foo => { value => "FOO" },
bar => { value => "BAR" },
};
print "$_\n" for xget($hash, qw(foo bar) );
####
$ ./1024343.pl
Can't use string ("2/8") as a HASH ref while "strict refs" in use at ./1024343.pl line 9.
####
#!/usr/local/bin/perl -w
use strict;
sub xget {
my $hash = shift;
return map $_->{'value'}, @$hash{@_};
}
my $hash = {
foo => { value => "FOO" },
bar => { value => "BAR" },
};
print "$_\n" for xget($hash, qw(foo bar) );
####
$ ./1024343.pl
FOO
BAR