Text::CSV - . DBD:: CSV, . DBI , , , , .
:
use strict;
use warnings;
use DBI;
$dbh = DBI->connect ("DBI:CSV:f_dir=/home/joe/csvdb")
or die "Cannot connect: $DBI::errstr";
$sth = $dbh->prepare ("SELECT id, name FROM info.txt WHERE id > 1 ORDER by id");
$sth->execute;
my ($id,$name);
$sth->bind_columns (\$id, \$name);
while ($sth->fetch) {
print "Found result row: id = $id, name = $name\n";
}
$sth->finish;
I would use Text :: CSV for this task if you do not plan to talk with other types of databases, but in Perl TIMTOWDI , and this helps to find out your options.
source
share