in reply to Output only certain fields from a hash using the Data::Dumper

In recent Perl, you can use the new hash slice syntax:
print Dumper { %hash {qw{ a b c }} };

In older Perls, you have to use a loop (or disguise it as map):

print Dumper { map { $_, $hash{$_} } qw( a b c ) };
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: Output only certain fields from a hash using the Data::Dumper
by MrSnrub (Beadle) on Jan 07, 2015 at 16:16 UTC
    That "older Perls" method worked well for basic hashes. But what if I have a hash of arrays of hashes? Can I filter out the keys in the inner hash?