kevyt has asked for the wisdom of the Perl Monks concerning the following question:
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' }, $l +ocation_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 wi +ll set a value # delete ($location_hash->{ $city }->{ 'ST' }) ; #### Addi +ng 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". }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Function hash by reference.
by BrowserUk (Patriarch) on Jan 07, 2007 at 23:06 UTC | |
by kevyt (Scribe) on Jan 07, 2007 at 23:14 UTC | |
|
Re: Function hash by reference.
by shigetsu (Hermit) on Jan 07, 2007 at 23:06 UTC | |
by kevyt (Scribe) on Jan 07, 2007 at 23:13 UTC |