Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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

by kevbot (Priest)
on Jul 30, 2017 at 05:53 UTC ( #1196287=note: print w/replies, xml ) Need Help??


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

It appears that ReadData requires a file handle when using the csv parser. The following seems to work.
#!/usr/bin/env perl use strict; use warnings; use v5.10; use Data::Dumper; use Spreadsheet::Read; my $data_str = "A,B,C\na,b,c"; open (my $fh, '<', \$data_str ) or die 'Could not open file handle'; my $data = ReadData( $fh, parser=>"csv", debug => 9 ); close($fh); say Dumper $data; exit;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2019-06-19 05:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Is there a future for codeless software?



    Results (84 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!