sub db_err { my ($pmsg, $psql, $perrnum, $perrstr) = @_; print "
There was a problem: $pmsg.
Attempted command: $psql
Error: $perrnum - $perrstr