in reply to Odd effects of mod_perl on IO::Socket or LWP::Protocol?
Is it running under CGI or under mod_perl? The simplest way to trace errors is to comment things out until they stop happening. A possibly better way is to use the debugger, which you can do under mod_perl. Check the docs for information on how to do it.
In Section
Seekers of Perl Wisdom