Server Q, Minor Response.pm problem fix

Eric Bennett (bennett@hpel.cees.edu)
Fri, 12 Apr 1996 06:31:39 -0400 (EDT)


Hello,

First the question:

Has anyone done any work on creating a ServerAgent class integrated into
LWP?  I could use this for proxy servers and for programs which use a 
browser as the front end.  It would also be very nice as a common 
interface for CGI scripts, making it easy to move them in and out of the 
server.


Now the bug fix:

I just installed perl 5.002 and libwww-perl-5b11 on a DEC Alpha
running OSF/1 v3.2  and I encountered a small problem with lwp-request.  
Every request was returning with an error to the effect of "scheme '1' 
unknown".  After poking about I found the problem to be at line 119 in 
site_perl/HTTP/Response.pm:

       $self->{'_content'} =~ /<\s*base\s+href=([^\s>]+)/i;
       $base = $1;

The regexp was not matching anything, so $1 wasn't assigned into.  I 
presume that '1' was just it's previous value.  In any event, changing 
this to 

       $base = $1 if $self->{'_content'} =~ /<\s*base\s+href=([^\s>]+)/i;

corrected the problem.  Probably the if could bracket the following code 
too, but it seems to work fine this way.

	Eric B.