# Update the selected Database record sub UpdateDb { my ($dbh, $upd_query) = @_; # $dbh is already connected my $sth = $dbh->prepare($upd_query); # create $sth as a local, lexically-scoped variable unrelated to the global $Sth $sth->execute() or $ErrNum = '3007'; $ErrMess = $DBI::errstr; $sth->finish(); print "HIER $ErrMess
" }