sub runThis($procT) { my $dbh1=DBI->connect("dbi:ODBC:$db","$usr","$pass", {RaiseError => 1 , PrintError => 0} ); $sqlstmt1 = "BEGIN $procT END;"; $sth1 = $dbh1->do($sqlstmt1) or die $dbh1->errstr; $dbh1 -> disconnect; } runThis("BEGIN NULL; END;");