#up top my $dbh=DBI->connect("DBI:Pg(RaiseError=>1,AutoCommit=>0),dbname=xyzzy"); #later eval { my($sth); $stmt="SELECT cnam_oficial FROM evocrs WHERE evocrs_id=?"; $sth=$dbh->prepare($stmt); $sth->execute($ec); $sth->bind_columns( \( $cn ) ); $sth->fetch; # $dbh->commit; #if we were writing some records instead of reading }; if($@) { # $dbh->rollback; #if we were doing transactions and writing data print STDERR "Could not retreive course name: $stmt: $@\n"; print "Could not retrieve course name\n"; exit; }