I know it was suggested earlier - maybe you should move the use commands outside of the subroutine. And change: > $ua = LWP::UserAgent->new; > $ua->agent("Netscape/4.7 " . $ua->agent); to be > my $ua = LWP::UserAgent->new; > my $ua->agent("Netscape/4.7 " . $ua->agent); Now, I'm no Perl dude - but um... yeah, give it a try :) (can't hurt!) Charles Daminato TUCOWS Product Manager (ccTLDs) [EMAIL PROTECTED] On Wed, 17 Jan 2001, Robert wrote: > > > I have a situationj here where the following are set up in the scirpt first. > ========================== > use strict; > use lib $PATH_LIB; > use CGI qw(:cgi-lib :all); > use OpenSRS::XML_Client qw(:default); > > ....... more code > > # create a client object which we will use to connect to the OpenSRS server > $XML_Client = new OpenSRS::XML_Client(%OPENSRS); > $XML_Client->login; > > ...........more code > > use HTTP::Request::Common; > use LWP::UserAgent; > $ua = LWP::UserAgent->new; > $ua->agent("Netscape/4.7 " . $ua->agent); > > Now, when a subroutine is called to do the LWP bit, > I get this error message. > Can't call method "request" on an undefined value at > /usr/local/lib/perl5/site_perl/5.6.0/LWP/UserAgent.pm line 227. > > IF I comment out the lines beginning with $XML, then the LWP part works. !!! > > So what is it about the $XML_Client that is trashing the LWP handler? > > bob > >