in reply to Re^2: Replace commas with spaces between quotes, parsing CSV
in thread Replace commas with spaces between quotes, parsing CSV

I had tried throwing his line in my script here -

my $filename = 'tested.csv'; open my $FH, $filename or die "Could not read from $filename <$!>, program halting."; # Read the header line. chomp(my $line = <$FH>); my $i = 0; $line = join '', grep { $i++ % 2 ? {s/,/ /g} : 1} split /"/,$line; my @fields = split(/,/, $line); print Dumper(@fields), $/; my @data; # Read the lines one by one. while($line = <$FH>) {

and got this when I tried to run the script -

Use of uninitialized value in join or string at AlterDataNew.pl line 2 +9, <$FH> line 5.