Doh! I didn't have the proper syntax. Forgot I was dealing with a hash reference in the map function. This works:
my %colors = map { $_ => $hash->{$_} } grep { $_ =~ /color$/ } keys %$ +hash;
$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks
In reply to Re: Hash filter one-liner not working as expected
by nysus
in thread Hash filter one-liner not working as expected
by nysus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |