$file = new IO::File "$fn";
if (!$file) {
dbg('err', "Error reading $fn $!");
+ Log('err', "Error reading $fn $!");
return undef;
}
$size = -s $fn;
$size -= length $line;
if (! $line =~ /^===/o) {
dbg('err', "corrupt first line in $fn ($line)");
+ Log('err', "corrupt first line in $fn ($line)");
return undef;
}
$line =~ s/^=== //o;
$size -= length $line;
if (! $line =~ /^===/o) {
dbg('err', "corrupt second line in $fn ($line)");
+ Log('err', "corrupt second line in $fn ($line)");
return undef;
}
$line =~ s/^=== //o;
$file = new IO::File;
if (!open($file, $fn)) {
dbg('err' ,"Error reading $fn $!");
+ Log('err' ,"Error reading $fn $!");
return undef;
}
@out = map {chomp; $_} <$file>;