%hash = ( key1 => 'A', key2 => 'B', key3 => 'C' ); for my $key ( qw/key1 key2 key3/ ) { eval( '$' . "$key = \$hash{\$key}"; } print $key1 . $key2 . $key3;