If a CSV file leads with a BOM (such as Excel will produce with CSV UTF8 output), then this gets sucked into the header. If you were using Text::CSV_XS directly, you'd pass detect_bom into the header method (it's not an argument to the constructor), however, your module never uses that. As such, this module can't be used with many Excel-produced CSV files.
use Parse::CSV; my $line = Parse::CSV->new( file => 'bad.csv', names => 1 )->fetch; my ($bad_key) = grep { /domain/ } keys %$line; use Data::Dumper; print Dumper( $bad_key );
prints:
$VAR1 = "\x{feff}domain";
on the attached CSV (zipped because Github is bad).
If a CSV file leads with a BOM (such as Excel will produce with CSV UTF8 output), then this gets sucked into the header. If you were using Text::CSV_XS directly, you'd pass
detect_bom
into the header method (it's not an argument to the constructor), however, your module never uses that. As such, this module can't be used with many Excel-produced CSV files.use Parse::CSV; my $line = Parse::CSV->new( file => 'bad.csv', names => 1 )->fetch; my ($bad_key) = grep { /domain/ } keys %$line; use Data::Dumper; print Dumper( $bad_key );
prints:
$VAR1 = "\x{feff}domain";
on the attached CSV (zipped because Github is bad).
bad.csv.zip