Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^3: How to set variable names using Text::CSV?

by Tux (Canon)
on Oct 19, 2009 at 12:51 UTC ( [id://801982]=note: print w/replies, xml ) Need Help??


in reply to Re^2: How to set variable names using Text::CSV?
in thread How to set variable names using Text::CSV?

my $dbh = DBI->connect ("dbi:CSV:", undef, undef, { f_dir => "DEMO.db:", f_ext => ".csv/r", f_schema => undef, PrintError => 1, RaiseError => 1, });

The disadvantage of this when the data set grows bigger is that all of your CSV data is kept in memory, and probably even twice. That, plus some meta-data will quickly gobble up most of your available valuable memory. If you want an intermediate database to make a move to something real later on, and still want portability, skip DBD::CSV and use DBD::SQLite instead. It is lightweight, fast and portable and supports a lot more than CSV.


Enjoy, Have FUN! H.Merijn

Replies are listed 'Best First'.
Re^4: How to set variable names using Text::CSV?
by Marshall (Canon) on Oct 19, 2009 at 17:04 UTC
    Thanks! for your suggestion of SQLite, I will see if I can get it on Windows! After I wrote my post, I generated the starting database, about 14K lines. This will grow in a very short time to about 50K lines. I know from experience and a lot of testing on other Perl applications that I won't start having trouble until memory footprint reaches > 1/2 GB. But that can happen quickly!

    The basic thing is to get started using SQL for this stuff! I want to port the existing process first (which can be done with some "lite" tools), then on the "features to do list" are things that will require MUCH larger DB's. So, yes, portability of code is a factor if it is possible to do.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2024-04-20 03:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found