in reply to Re^3: text::csv output help
in thread text::csv output help

What are the rows supposed to contain? How do you keep track of rows, they are all appearing on one line. Should I insert the "\n" character in somewhere? Otherwise I get the error: Expected fields to be an array ref at path line x. Say for example I wanted to make 2 rows of a CSV file, can you provide some code to do that? Regards, Dave

Replies are listed 'Best First'.
Re^5: text::csv output help
by Tux (Canon) on Dec 01, 2010 at 07:39 UTC

    $csv->print (...) only prints a newline if it is told to do so. You can tell it to do so either in the constructor

    my $csv = Text::CSV->new ({ binary => 1, auto_diag => 1, eol => "\n" });

    Or at a leter stage

    my $csv = Text::CSV->new ({ binary => 1, auto_diag => 1 }); $csv->eol ("\r\n");

    Enjoy, Have FUN! H.Merijn