[Koha-patches] [PATCH] minor corrections to check-url.pl

Galen Charlton galen.charlton at liblime.com
Thu Feb 26 22:16:08 CET 2009


* removed ersataz YAML::XS dependency
* use 'return' instead of 'return undef'
* minor language changes
---
 misc/cronjobs/check-url.pl |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/misc/cronjobs/check-url.pl b/misc/cronjobs/check-url.pl
index 64c16c9..381c122 100755
--- a/misc/cronjobs/check-url.pl
+++ b/misc/cronjobs/check-url.pl
@@ -63,6 +63,8 @@ With 2 URLs, the returned array will look like that:
 
 =cut
 
+use strict;
+use warnings;
 use LWP::UserAgent;
 use HTTP::Request;
 use C4::Biblio;
@@ -88,7 +90,7 @@ sub check_biblio {
     my $host            = $self->{ host_default };
 
     my $record = GetMarcBiblio( $biblionumber ); 
-    return undef unless $record->field('856');
+    return unless $record->field('856');
 
     my @urls = ();
     foreach my $field ( $record->field('856') ) {
@@ -120,8 +122,6 @@ use warnings;
 use diagnostics;
 use Carp;
 
-use YAML::XS;
-
 use Pod::Usage;
 use Getopt::Long;
 use C4::Context;
@@ -196,7 +196,7 @@ if ( $html && !$host_pro ) {
         $host_pro = $host;
     }
     else {
-        print "Error: host_pro parameter or host must be provided in html mode\n";
+        print "Error: host-pro parameter or host must be provided in html mode\n";
         exit;
     }
 }
@@ -215,7 +215,8 @@ check-url.pl - Check URLs from 856$u field.
 
 =item check-url.pl [--verbose|--help] [--host=http://default.tld] 
 
-Scan all URL found in 856$u and display if ressources are available or not.
+Scan all URLs found in 856$u of bib records 
+and display if resources are available or not.
 
 =back
 
@@ -231,7 +232,7 @@ For example, if --host=http://www.mylib.com, then when 856$u contains
 
 =item B<--verbose|-v>
 
-Outputs succeed URL checks with failed ones. 
+Outputs both successful and failed URLs.
 
 =item B<--html>
 
-- 
1.5.5.GIT




More information about the Koha-patches mailing list