while (my ($k,$v)= each %stuff_to_store) { #see if it worked by printing out each element of hash stuff_to_store print $_, $v; #its not working and I don't know why }