in reply to Spreadsheet::Read not reading CSV data passed as string

Well, no need to pray at line 547 in Spreadsheet::Read .-)
It should be

- $in = $txt; # Now pray ... + open $in, '<', \$txt or return;

since below follows

while (my $row = $csv->getline ($in)) {

which doesn't work on a plain string, but on a file handle.

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

Replies are listed 'Best First'.
Re^2: Spreadsheet::Read not reading CSV data passed as string
by Tux (Canon) on Jul 30, 2017 at 09:12 UTC

    That would break perl -MDP -MSpreadsheet::Read -we'$_="a,b,c\n1,2,3\n";open$a,"<",\$_;DDumper ReadData($a,parser=>"csv",debug=>9)'


    Enjoy, Have FUN! H.Merijn
      That would break

      Adding case for a GLOB ref:

      else { if ($io_ref) { # GLOB/IO ref $in = $txt; # Now pray ... } else { # just text open $in, "<", \$txt or return; } }
      perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

        I did something similar. Care to prove I missed something?

        $ wget --output-document=Spreadsheet-Read-git.tgz \ 'https://github.com/Tux/Spreadsheet-Read/archive/master.tar +.gz'

        Thanks for thinking along :)


        Enjoy, Have FUN! H.Merijn