http://qs321.pair.com?node_id=11112500


in reply to Iterating over an hash while removing keys

You don't have to call scalar. Using a void context resets the iterator without even checking the keys at all.
- scalar(keys %$hash); # Force reset + keys %$hash; # Force reset

Update: Documented in keys:

> In particular, calling "keys" in void context resets the iterator with no other overhead.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]