my $location_hash = get_location(\*ZIPS); my $cat_hash = get_categories (\*SICS); for my $city ( keys %$location_hash ) { printf "%s %s %s\n", $city, $location_hash->{ $city }->{ 'ST' }, $location_hash->{ $city }->{ 'ZIP' } ; for my $cat ( keys %$cat_hash) { printf "%s %s\n", $cat, $cat_hash->{ $cat }->{ 'NUM' } ; . . . catch_error(\*LOGS, \$page, \$location_hash, \$cat_hash ); # how can I pass by ref ? # I cant seem to delete the keys that were used. So so I will set a value # delete ($location_hash->{ $city }->{ 'ST' }) ; #### Adding another post about this because I cant remove the key $location_hash->{ $city }->{ 'PR' } = 1; $cat_hash->{ $cat }->{ 'PR' } = 1; } # for my $cat ( keys %$cat_hash) } # for my $city ( keys %$location_hash ) { sub catch_error{ my ($fh, $str, % ) = @_; # confused right here! ### Then I will print to the log and I will print the keys ### and values from the hashes that I did not process. ### I am having a problem deleting the key so I added a key and set it to 1 ### I will create another posting for that question titled "How can I delete a key from a hash". }