Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Spreadsheet::Read not reading CSV data passed as string

by shmem (Chancellor)
on Jul 30, 2017 at 08:24 UTC ( [id://1196289]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1196289]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-19 02:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found