robbiebow / Text-CSV-Slurp

Text::CSV::Slurp - lazy CSV handling in Perl
1 stars 5 forks source link

Doesn't work with "file" option #7

Open nigelhorne opened 7 years ago

nigelhorne commented 7 years ago

$self->{'data'} = Text::CSV::Slurp->load(file => $slurp_file, %options);

gives:

Can't call method "getline" on an undefined value at /Users/hornenj/perl5/perlbrew/perls/perl-5.26.0/lib/site_perl/5.26.0/Text/CSV/Slurp.pm line 97.

Also looks like you don't check if the Text::CSV->new() fails.

nigelhorne commented 7 years ago
        my %options = (
            allow_loose_quotes => 1,
            blank_is_undef => 1,
            empty_is_undef => 1,
                            f_file => $slurp_file,
            binary => 1,
            escape_char => '\\',
            sep_char => '!',
        );
nigelhorne commented 7 years ago

Update:

The problem is caused by the f_file entry in options.