##
my %new2 =
hmap { $_[1]{nick} =~ /rbush|fred/
? $_[0] => { hmap { $_[0], $_[1] } %{$_[1]} }
: ()
} %$h;
####
sub hmap (&$)
{
my $code = shift;
my @i = %{ shift() };
my @rv;
push @rv, $code->(shift @i,shift @i) while @i;
return { @rv };
}
my $new2 =
hmap { $_[1]{nick} =~ /rbush|fred/
? $_[0] => hmap { $_[0], $_[1] } $_[1]
: ()
} $h;