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


in reply to setting hash keys by array

See Re: descending a tree of hash references for a discussion of the same problem. Most of the solutions in this thread are handy, but sometimes it's useful to be able to wrap it into a subroutine.

perl -pe '"I lo*`+$^X$\"$]!$/"=~m%(.*)%s;$_=$1;y^`+*^e v^#$&V"+@( NO CARRIER'