my $t_fmt = '%Y-%m-%d %H:%M:%S';
-warn "## Conf = ",dump( \%Conf );
+#warn "## Conf = ",dump( \%Conf );
my $dbh = DBI->connect($Conf{SearchDSN}, $Conf{SearchUser}, "", { RaiseError => 1, AutoCommit => 0 });
}
open(my $gzip, $Conf{GzipPath}." -l $filename |") || die "can't gzip -l $filename: $!";
+ local $/ = undef;
my $line = <$gzip>;
- chomp($line);
- $line = <$gzip> if ($line =~ /^\s+compressed/);
+ close($gzip);
my ($comp, $uncomp) = (0,0);
- if ($line =~ m/^\s+(\d+)\s+(\d+)\s+\d+\.\d+/) {
+ if ($line =~ m/\s+(\d+)\s+(\d+)\s+\d+\.\d+/s) {
if (wantarray) {
return [ $1, $2 ];
} else {
return $2;
}
} else {
- die "can't find size in line: $line";
+ warn "ERROR can't parse: $line";
+ return -s $filename;
}
}