Sorry. Forgot to mention. $Host already contains http://servername
Thanks Rajesh -----Original Message----- From: Sethi, Pradeep [mailto:[EMAIL PROTECTED] Sent: Monday, November 10, 2003 1:23 PM To: Rajesh Dorairajan Subject: RE: Peculiar problem using LWP::UserAgent What's the value of $Host ? Try this : my $url = "http://$Host:$Port"; #Does not work -----Original Message----- From: Rajesh Dorairajan [mailto:[EMAIL PROTECTED] Sent: Monday, November 10, 2003 1:16 PM To: '[EMAIL PROTECTED]' Subject: Peculiar problem using LWP::UserAgent I ran into peculiar problem using LWP::UserAgent. I receive a 501 - Not yet implemented error when I connect to a web-server using the User-Agent. This happens when I pass in the Hostname and Portnumber as parameters in my function. However, if I hard-code the Server-name and port number it seems to work fine. I've included the piece of causing the problem below. Does anyone have suggestion why this is happening? my ( $Host, $Port ) = @_; my $url = "$Host:$Port"; #Does not work #my $url = "http://servername:80" #This works require LWP::UserAgent; my $ua = LWP::UserAgent->new(env_proxy => 0, keep_alive => 0, timeout => 30, ); $response = $ua->get( $url ); Thanks in Advance, Rajesh Dorairajan