my $i = 0;
my $count;
-while ($_ = shift @lines) {
- if ($i == 0) {
- $count = @$_;
- } else {
- for (my $j=@$_; $j<$count; $j++ ) {
- $_->[$j] = '';
- }
+while (my $line = shift @lines)
+{
+ # NB 16.04.23: I guess it was supposed ad missing columns
+ # NB 16.04.23 if ($i == 0)
+ # NB 16.04.23 {
+ # NB 16.04.23 $count = @$line;
+ # NB 16.04.23 }
+ # NB 16.04.23 else
+ # NB 16.04.23 {
+ # NB 16.04.23 for (my $j=@$line; $j<$count; $j++ )
+ # NB 16.04.23 {
+ # NB 16.04.23 $line->[$j] = '';
+ # NB 16.04.23 }
+ # NB 16.04.23 }
+ # Add missing empty columns
+ for (my $j=@$line; $j<@len; $j++ )
+ {
+ $line->[$j] = '';
}
- printf $format,@$_;
+ printf $format,@$line;
print $sep_line if $Opt{header} and !$i++;
}