14.17 CSVファイルをSQLで問い合わせる
use DBI; $dbh = DBI->connect("dbi:CSV:f_dir=/home/gnat/payroll", "", "", { AutoCommit => 1, RaiseError = > 1 }); $dbh->do("UPDATE salaries SET salary = salary * 2 WHERE name = 'NAT'"); $sth = $dbh->prepare("SELECT name, salary FROM salaries WHERE name = 'NAT'"); $sth->execute(); while (@row = $sth->fetchrow_array) { # ... } $sth->finish(); $dbh->disconnect();