in reply to delete hash key/value in subroutine
Could we see some code? There are multiple things that could have gone wrong. If you have not already, please use strict; in your script and declare all variables with local scope.
my %hash = ('key1' => 'v1', 'key2' => 'v2'); del_hash_key(\%hash); sub del_hash_key { my $params = shift; my %hash = %$params; delete $hash{'key1'}; print %hash; # Prints the latter key/value pair print "\n"; } print %hash; # Prints both key/value pairs
I'm so adjective, I verb nouns!
chomp; # nom nom nom
|
|---|