1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
my @colums1; while ( my $row = $csv->getline( $csv_1 ) ) { next if 0 == $#{$row}; next if 6 == $#{$row}; my ( $significator, $filename ) = split m{\s+}, $row->[0]; if ( $significator eq 'default' ) { @colums1 = @$row; shift @colums1; warn Data::Dumper->Dump( [ \@colums1 ], [ '*columns1' ] ) if $ENV{DEBUG}; } elsif ( $significator eq 'false' ) { warn Data::Dumper->Dump( [ $row ], [ '*row' ] ) if $ENV{DEBUG}; open (my $Fhhtml, ">", "$filename.csv") or die "Can't open per-line file $filename: $!\n"; shift @$row; for my $i ( 0 .. $#{$row}-1 ) { $colums1->{$i} = '' unless (defined($colums1->{$i})); #line 96 print $Fhhtml "$colums1[$i] : $row->[$i] : $data2{$colums1[$i]}\n"; } close $Fhhtml or die "close($filename,w) failed: $!"; } }