use File::Copy; my %hash=(a=>1,b=>2); copy($hash{a}, $hash{b}) or die $!;