in reply to Interpolation of variables read from a file
Then in your code, you can iterate on keys instead of this hardcoded list.# data.pl ( act => { "food" => "eat it", "drink" => "drink it", "Perl" => "play it", }, act1 => { "foo" => "bar", "baz" => "biz", }, );
Or something to that effect.my %hash = do 'data.pl'; my $item = "Perl"; my $out = grep {-p $_->{$item}} values %hash ? 1 : 0;
|
|---|