in reply to perl and psql
Yes you can and in a very simple manner. I'll sketch the outline and leave you to fill in the details as it's a very useful learning exercise.
Instead of printing, call a SQL command to insert them into a table. That is, use something like something like:
$dbh->foreach my $cluster (@clusters) { do ("INSERT INTO $table (start, end) VALUES (cluster[0], cluster[1]);" +); } # Ensure that the insertion is committed (or set auto-commit when fir +st connecting to the DB). $dbh->commit();
This presumes you have created a psql table, the name of which is held in $table, with columns called 'start' and 'end'. Creating that table is left as an easy exercise.
Paul
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: perl and psql
by almut (Canon) on Dec 02, 2009 at 14:18 UTC | |
|
Re^2: perl and psql
by gogoglou (Beadle) on Dec 02, 2009 at 14:14 UTC | |
by bv (Friar) on Dec 02, 2009 at 14:29 UTC | |
by almut (Canon) on Dec 02, 2009 at 15:59 UTC | |
by Xilman (Hermit) on Dec 02, 2009 at 17:11 UTC |