I wonder if there's a hash filter function somewhere, as in:
my $new_ref = filter_hash { $a =~ /color/ and !ref $b } $hashref;
Where $a is each key and $b is the corresponding value. Seems trivial to write, so it must exist.
UPD: Here: Hash::MostUtils - called hashgrep.
In reply to Re: Hash filter one-liner not working as expected
by Dallaylaen
in thread Hash filter one-liner not working as expected
by nysus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |