That's right, I'd like to use both a http request and a database connection. My main requirement is - send a post request to a http server and see what the response is, if it's a success, then run a stored proc at the backend to update a table with the response from the http server. The code I posted is a simplfied form of the actual code, which curently waits infinitely during the $dbh->selectall_arrayref() execution (and not the $ua = LWP::UserAgent->new() call). I guess there are some problems when you are using both these two modules in a single script, however, I could not find any specific document describing the source of the problem or anything to solve it (that is, to have a http request and a dbi call in the same script). Any help?