in reply to Re^2: Get CSV data and convert it to other format data dynamically.
in thread Get CSV data and convert it to other format data dynamically.

Text::CSV offers a more robust interface than:

my @csv; while (<$fh>) { chomp $_; my @p = split /,/, $_; push @csv, \@p; }

or something like that. If your goal is to be robust, I'd use the module that is solely dedicated to reading that type of data and then another that helps you transform it. Not sure about the JSON output, you're getting a bit out of my league there, but again, if you're looking for robust, readable, supportable code, use the module that's been vetted by all CPAN'ers versus rolling your own.

  • Comment on Re^3: Get CSV data and convert it to other format data dynamically.
  • Download Code