$sth is a persistent variable. That way I can use it in the unless statement. The connect to the database uses its own persistent variable if its already defined it just returns it if its not it performs a connect. I am not disconecting and reconnecting, I only connect once. By doing it this way I don't have to pass connection handles all over the place.
Hibbarra