Hello Gisle and all,
I use the following local patch to LWP::RobotUA :
% perldoc -m LWP::RobotUA.pm | diff - lib/LWP/RobotUA.pm
1c1
< # $Id: RobotUA.pm,v 1.17 2000/04/09 11:21:11 gisle Exp $
---
> # $Id: RobotUA.pm,v 1.171 2000/08/09 11:25:23 cvs Exp $
7c7
< $VERSION = sprintf("%d.%02d", q$Revision: 1.17 $ =~ /(\d+)\.(\d+)/);
---
> $VERSION = sprintf("%d.%02d", q$Revision: 1.171 $ =~ /(\d+)\.(\d+)/);
234c234,235
< my $netloc = $request->url->host_port;
---
> my $ru = $request->url;
> my $netloc = $ru->can('host_port') ? $ru->host_port : $ru->host;
Not all URIs actually have a host_port method defined, and this would
cause my (also modified) WWW::Robot to crash. However, can() is a
fairly new Perl feature. I don't think RobotUA should fail on things
like this.
+ Is there a better way to address this?
+ Would it be possible to incorporate this into the standard version?
I hate having to drag my own patches around ...
--
Reinier