Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: CSV column names

by Tux (Canon)
on Aug 27, 2016 at 15:28 UTC ( [id://1170586]=note: print w/replies, xml ) Need Help??


in reply to CSV column names

Why so difficult???

$ cat info.csv id,count,desc,asc,row 1,2,foo,bar,10 $ cat test.pl #!/pro/bin/perl use 5.18.2; use warnings; use DBI; use Data::Peek; my $dbh = DBI->connect ("dbi:CSV:", undef, undef, { f_ext => ".csv/r" +}); my $sth = $dbh->prepare ("select * from info"); $sth->execute; while (my $row = $sth->fetchrow_hashref) { DDumper $row; } $ perl test.pl { asc => 'bar', count => 2, desc => 'foo', id => 1, row => 10 } $

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://1170586]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-03-29 07:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found