#!/usr/bin/perl -w use strict; use Text::CSV_XS; # Slurp up the whole file open(INF,"; close(INF); # Convert CRs to LFs $file =~ s/\015/\012/g; # Parse CSV file line-by-line my $csv = Text::CSV_XS->new(); for my $i (split /\012+/, $file) { my $status = $csv->parse($i); print "ST:", $status; for my $j ($csv->fields) { print " [", $j, "]"; } print "\n"; }