#!/usr/local/bin/perl use strict; use DBI; my $dbh = DBI->connect("DBI:Pg:host=postgres.cise.ufl.edu;dbname=projectdb", "myusername", "mypassword"); my $sth = $dbh->prepare("select * from mytable where mycol = ?") || die "Error in DBI::prepare: $!"; $sth->execute("myval") || die "Error in sth::execute: $!"; while (my $row = $sth->fetchrow_arrayref) { print "@$row\n"; } $dbh->disconnect;