Subject: | Extend search path for linkcheck script |
W3C::LogValidator::LinkChecker is not able to find the linkcheck script on my system, because my perl is setup to install binaries in a non-standard place.
I think your module should first search for linkcheck in the directories
$Config{scriptdirexp} and $Config{binexp}, as these directories are used by
perl to install scripts/binaries. See the attached patch.
Regards,
Slaven
#
#
# To apply this patch:
# STEP 1: Chdir to the source directory.
# STEP 2: Run the 'applypatch' program with this patch file as input.
#
# If you do not have 'applypatch', it is part of the 'makepatch' package
# that you can fetch from the Comprehensive Perl Archive Network:
# http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz
# In the above URL, 'x' should be 2 or higher.
#
# To apply this patch without the use of 'applypatch':
# STEP 1: Chdir to the source directory.
# STEP 2: Run the 'patch' program with this file as input.
#
#### End of Preamble ####
#### Patch data follows ####
diff -up 'build/W3C-LogValidator-1.01/lib/W3C/LogValidator/LinkChecker.pm' 'new.build/W3C-LogValidator-1.01/lib/W3C/LogValidator/LinkChecker.pm'
Index: ./lib/W3C/LogValidator/LinkChecker.pm
Prereq: 1.3
--- ./lib/W3C/LogValidator/LinkChecker.pm Fri Sep 9 08:33:11 2005
+++ ./lib/W3C/LogValidator/LinkChecker.pm Sat Dec 17 15:56:59 2005
@@ -10,6 +10,7 @@ package W3C::LogValidator::LinkChecker;
use strict;
use warnings;
+use Config;
require Exporter;
our @ISA = qw(Exporter);
@@ -74,7 +75,8 @@ sub path_checklink
}
}
if ($found == 0) {
- foreach ('/usr/bin/checklink', '/bin/checklink', '/usr/local/bin/checklink', './checklink'){
+ foreach ("$Config{scriptdirexp}/checklink", "$Config{binexp}/checklink",
+ '/usr/bin/checklink', '/bin/checklink', '/usr/local/bin/checklink', './checklink'){
$cl_path = $_;
print "looking for checklink at: $cl_path..." if ($verbose >1);
#### End of Patch data ####
#### ApplyPatch data follows ####
# Data version : 1.0
# Date generated : Sat Dec 17 16:00:41 2005
# Generated by : makepatch 2.00_05
# Recurse directories : Yes
# p 'lib/W3C/LogValidator/LinkChecker.pm' 8468 1134831419 0100644
#### End of ApplyPatch data ####
#### End of Patch kit [created: Sat Dec 17 16:00:41 2005] ####
#### Patch checksum: 35 1357 36796 ####
#### Checksum: 53 1981 22799 ####