#! /usr/bin/perl ## # @file download-standings # @author James Ryan connect("DBI:mysql:$db_name:$db_host", $db_user, $db_pass) || die "Connect failed.\nDBI::errstr\n" unless $dbh; } # disconnects from ppages db sub disconnect() { $dbh->disconnect; } # perform an SQL command sub sql() { eval { $sth = $dbh->prepare($_[0]); }; if ($@) { &disconnect(); print "An error occured while accessing the database."; exit; } else { $sth->execute; } return ($sth); }