DB<7> $exclude = sub { my $href = shift; my $excl= join '|', @_; r +eturn +{ %$href{ grep !/^$excl$/, keys %$href } } } DB<8> x $h_ref 0 HASH(0x3168da0) 'a' => 1 'b' => 2 'c' => 3 'log' => 'l' 'schema' => 's' DB<9> x $h_ref->$exclude(qw/log schema/) 0 HASH(0x32e1158) 'a' => 1 'b' => 2 'c' => 3 DB<10>
Cheers Rolf
(addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
Wikisyntax for the Monastery
In reply to Re^2: Hash/Array slice : how to exclude items?
by LanX
in thread Hash/Array slice : how to exclude items?
by bliako
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |