in reply to How to extract part of a hash
@pets{@$_} = @hash{@$_} for [qw(dog cat)];
That's the shortest I can contrieve. The temporary variable still exists, but IMHO it's okay to use $_ for that.
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
|
|---|