--- pipe2sap.pl 2003/02/03 14:24:55 1.3 +++ pipe2sap.pl 2003/02/03 14:30:50 1.4 @@ -62,13 +62,14 @@ my @data; # array for order my $lines; # number of lines in order +my $nr; # order number my $first = ; push @data,$first; chomp $first; $first=~s/ //g; if ($first =~ m/\s+(\d+)\s+(\d+)\w+\s*$/) { - my ($nr,$lines) = ($1,$2); + ($nr,$lines) = ($1,$2); print "Processing $lines lines order no. $nr\n"; } else { die "FATAL: can't find number of lines in first line ($first) of input file."; @@ -83,11 +84,11 @@ if ($#data != $lines) { print "FATAL: file integrity check failed: "; if ($#data > $lines) { - print "too many"; + print "too many ($#data > $lines)"; } else { - print "too few"; + print "too few ($#data < $lines)"; } - print " lines ($#data)...\n"; + print " lines...\n"; } else { print "File integrity checked, saving file...\n"; open(OUT, "> $outdir/$outfile") || die "FATAL: can't open '$outdir/$outfile': $!";