in reply to Re^2: Deleting undefined entries from DB_FILE hash
in thread Deleting undefined entries from DB_FILE hash
Instead of this:
Try this and see what you get:foreach my $key ( keys %hash ) { 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.*|;
foreach my $key ( keys %hash ) { my @tmp = split /\s+/, $hash{$key}; my $type = $tmp[0]; my $dt = $tmp[1]; my ($year, $month, $day) = ('','',''); if($dt =~ m|(\d{4})(\d{2})(\d+{2})T.*$|){ ($year, $month, $day)=($1,$2,$3); } ...... ...... printf("bucket: %s\ttype: %s\t%s-%s-%s\t%s\n",$bucket +,$type,$year,$month,$day,$dt); ......
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Deleting undefined entries from DB_FILE hash
by gossamer (Sexton) on Jul 24, 2012 at 02:34 UTC |