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


in reply to Bulk Hash Assignment

YAWTDI -- you could use an anonymous function...

sub { for(map{$_*2} 0..$#_/2) { $bfb->{$_[$_+1]} = $ofb{$_[$_]} }}->(q +w[camshaft camshaft ...]);

Or, alternatively:

sub { my%g=@_; for(keys%g) { $bfb->{$g{$_}} = $ofb{$_} }}->(qw[camshaf +t camshaft ...]);