Re: libwww-perl-5b8

Gisle Aas (aas@bergen.sn.no)
Tue, 27 Feb 1996 15:15:30 +0100


In message <9602271333.AA22715@pluto>, Nick Ing-Simmons writes:
> Now a problem which I had with 5b7 too:
> 
> Is this (cut down) approach valid: 
> 
> #!/usr/local/bin/perl -w
> use LWP;
> 
> @ARGV = __FILE__ unless (@ARGV);
> my $url = URI::URL->new($ARGV[0],URI::URL->newlocal);
> $url = $url->abs;
> 
> my $sec = URI::URL->new("#Section0",$url);
> print $sec->as_string,"\n";
> 
> # This fails:
> my $abs = $sec->abs;
> print $abs->as_string,"\n";
> 
> __END__
> 
> Illegal method for file URLs at /usr/local/lib/perl5.new/auto/URI/URL/_generi
c/abs.al line 39

Try this patch:

Index: _generic.pm
===================================================================
RCS file: /f/stovner/utvikling/CVSROOT/aas/perl/mods/libwww-perl/lib/URI/URL/_generic.pm,v
retrieving revision 1.3
diff -u -r1.3 _generic.pm
--- _generic.pm 1996/02/26 18:53:50     1.3
+++ _generic.pm 1996/02/27 13:57:43
@@ -349,11 +349,12 @@
     if ($path eq '') {                          # (5)
         $embed->{'path'} = $base->{'path'};     # (5)
 
-        return $embed if $embed->params;        # (5a)
-        $embed->{'params'} = $base->{'params'}; # (5a)
+        return $embed if defined $embed->{'params'}; # (5a)
+        $embed->{'params'} = $base->{'params'};      # (5a)
+
+        return $embed if defined $embed->{'query'};  # (5b)
+        $embed->{'query'} = $base->{'query'};        # (5b)
 
-        return $embed if $embed->query;         # (5b)
-        $embed->{'query'} = $base->{'query'};   # (5b)
         return $embed;
     }
 

--Gisle