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' } ; . . . delete ($location_hash->{ $city }) ; ### This is wha +t I want.... Does not work delete ($location_hash->{ $city }->{ 'ZIP' } ); ### Does not wo +rk delete ($cat_hash->{ $cat }->{ 'NUM' }); ### Does not wo +rk delete ($cat_hash->{ $cat }); ### This is wha +t I want.... Does not work } # for my $cat ( keys %$cat_hash) } # for my $city ( keys %$location_hash ) {
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How can I delete a key' value from a hash
by GrandFather (Saint) on Jan 07, 2007 at 23:17 UTC | |
by kevyt (Scribe) on Jan 08, 2007 at 05:05 UTC | |
|
Re: How can I delete a key' value from a hash
by ysth (Canon) on Jan 07, 2007 at 23:10 UTC | |
by kevyt (Scribe) on Jan 07, 2007 at 23:46 UTC | |
by Animator (Hermit) on Jan 08, 2007 at 12:16 UTC | |
|
Re: How can I delete a key' value from a hash
by OfficeLinebacker (Chaplain) on Jan 07, 2007 at 23:35 UTC | |
by kevyt (Scribe) on Jan 07, 2007 at 23:48 UTC | |
|
Re: How can I delete a key' value from a hash
by roman (Monk) on Jan 08, 2007 at 11:15 UTC |