Front page | perl.libwww |
Postings from April 2001
From: Reinier Post
April 24, 2001 08:05
Message ID: 20010424170528.B21753@win.tue.nl
Hello Gisle and all,
I use the following local patch to LWP::RobotUA :
% perldoc -m LWP::RobotUA.pm | diff - lib/LWP/RobotUA.pm
< # $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 $
< $VERSION = sprintf("%d.%02d", q$Revision: 1.17 $ =~ /(\d+)\.(\d+)/);
> $VERSION = sprintf("%d.%02d", q$Revision: 1.171 $ =~ /(\d+)\.(\d+)/);
< 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
+ 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 ...
by Reinier Post