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;