in reply to text::csv output help

There's an example at the top of the link you posted. Just change @row to @array!

Replies are listed 'Best First'.
Re^2: text::csv output help
by dmn001 (Initiate) on Nov 30, 2010 at 22:13 UTC
    thanks. btw, it has to be an array ref. $csv->print ($fh, $_) for \@rows; instead of @rows as it appears in the documentation.

      No, the documentation is correct.

      $csv->print($fh, $_) for @rows;
      and
      $csv->print($fh, \@row);
      make sense, but not
      $csv->print($fh, $_) for \@rows;

      I imagine that your @rows didn't actually contain rows.

        @rows is supposed to contain a 2-d array? Can you give an example of the format? The error I get: "Expected fields to be an array ref at line x". Thx, Dave
        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