#!/usr/bin/perl use strict; use warnings; my %data = ( "blah"=>1, "boo"=>2, "hoo"=>3 ); # assign each key to a variable of the same name foreach (keys %data) { no strict; my $$_ = $data{$_}; } # end-foreach print $blah; exit;