$h{$_} // delete $h{$_} for keys %h
Unfortunately the even shorter approach doesn't work with deleting aliases
$_ // delete $_ for values %h
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
In reply to Re^2: Consise way to filter out keys with undef values from a hash slice?
by LanX
in thread Consise way to filter out keys with undef values from a hash slice?
by nysus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |