%hash = ( foo => 'bar', bar => [ 'foo' ] ); (ref() eq 'ARRAY') && $_ = \$hash{ $_->[0] } for values %hash;