Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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 exploiting the Monastery: (1)
As of 2021-04-17 05:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?