improved error reporting
authorShawn Boyette <sboyette@esilibrary.com>
Wed, 13 May 2009 14:48:49 +0000 (14:48 +0000)
committerShawn Boyette <sboyette@esilibrary.com>
Wed, 13 May 2009 14:48:49 +0000 (14:48 +0000)
csv_ripper

index 098d287..8ae35e9 100755 (executable)
@@ -14,13 +14,13 @@ use warnings;
 
 use Text::CSV;
 
-my $csv = Text::CSV->new();
+my $csv = Text::CSV->new( {binary => 1});
 
 open CSV, '<', shift or die "Can't open file $!\n";
 
 while (<CSV>) {
     $csv->parse($_);
-    die "Bad data on line $.\n" if ($csv->error_diag);
+    die "Bad data on line $.\n$_\n" if ($csv->error_diag);
     my @chunks = $csv->fields;
     my @out = ();
     for my $chunk (@ARGV)