$dbname = 'mitabla'; $host = 'miservidor.com'; $options = '-B 2048'; $username = 'lola'; $password = 'lolita'; $dbh = DBI->connect("dbi:Pg:dbname=$dbname;host=$host;options=$options", "$username","$password"); $sth = $dbh->prepare("insert into table(foo,bar,baz) values (?,?,?)"); while(<CSV>) { chop; my ($foo,$bar,$baz) = split /,/; $sth->execute($foo, $bar, $baz); }