The problem is that the delete($hash{$key}) doesn't seem to actually be deleting the hash
How do you delete undefined hash key?
if hash key is not present, there is nothing to delete.
Don't you think so?
Peruse this:
but if you write this:use Data::Dumper; my $family={ father=>'foo', mother=>'bar',}; for(keys %$family){ if(!defined($_)){ delete $family->{$_} } } print Dumper $family; # print out your hash
I think you might have to look at your code construct again.use Data::Dumper; my $family={ father=>'foo', mother=>'bar',}; for(keys %$family){ if(defined($_)){ delete $family->{$_} } } print Dumper $family; # print empty hash
UPDATE:
Also in this:
Hope, $qdir is decleared somewhere in your code?my $file = sprintf('%s/%s/%02x.db', $qdir, $mypc, $i);
In reply to Re: Deleting undefined entries from DB_FILE hash
by 2teez
in thread Deleting undefined entries from DB_FILE hash
by gossamer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |