http://www.perlmonks.org?node_id=1055869


in reply to Re^2: using hashes
in thread iterating hash keys?

In order to make things even more complicated I recommend to replace $hash{ $1 } with

$hash{ $1 } // $1

which means if $1 is not found in your hash, then replace your word with itself, ie leave it unchanged.