in reply to ODBC errors

I think two things will help you here:

The -w flag:  #!usr/bin/perl -w

and strict:  use strict;

With that you have to declare all global variable with my:

my $dbh; my $sth;

btw: what is #!usr/perl/bin ?