push @myhosts, 'mymail01'; push @myhosts, 'mymail02'; foreach my $mypc (@myhosts) { for (my $i = 0; $i < 256; $i++) { my $bucket = sprintf('%02x', $i); my $file = sprintf('%s/%s/%02x.db', $qdir, $mypc, $i); tie (my %hash, 'DB_File', $file, O_RDWR, 0600) || next; foreach my $key ( keys %hash ) { if (!defined $hash{$key}) { print "$key not defined\n"; delete($hash{$key}); untie %hash; exit 1; } # $type\t$d$t\t$size\t$from\t$to\t$subj\t$score my @tmp = split /\t/, $hash{$key}, 7; my $type = $tmp[0]; my $dt = $tmp[1]; my ($year, $month, $day) = $dt =~ m|(\d{4})(\d{2})(\d{2})T.*|; printf("bucket: %s\ttype: %s\t%s-%s-%s\t%s\n",$bucket,$type,$year,$month,$day,$dt) } untie %hash; #### bucket: aa type: spam 2012-07-07 20120707T204829 spam-aa0b162b5118763a9f053d1412f9f0b1-20120705T082627-27218-15.gz not defined Use of uninitialized value within %hash in concatenation (.) or string at ./list_hash.pl line 66.