From 8cfc1a0804aec420fc57d06892da40c45a0b0183 Mon Sep 17 00:00:00 2001 From: Mason James Date: Wed, 27 Jun 2012 00:43:07 +1200 Subject: [PATCH] Bug 6679 - fix 12 perlcritic violations in C4/External/BakerTaylor.pm Subroutine prototypes used at line 82, column 1. See page 194 of PBP. (Severity: 5) "return" statement with explicit "undef" at line 83, column 22. See page 199 of PBP. (Severity: 5) Signed-off-by: Jonathan Druart Signed-off-by: Paul Poulain --- C4/External/BakerTaylor.pm | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/C4/External/BakerTaylor.pm b/C4/External/BakerTaylor.pm index d7526774a3..d49aa8dc7f 100644 --- a/C4/External/BakerTaylor.pm +++ b/C4/External/BakerTaylor.pm @@ -50,26 +50,26 @@ sub initialize { #"Mozilla/4.76 [en] (Win98; U)", # if for some reason you want to go stealth, you might prefer this } -sub image_url (;$) { - ($user and $pass) or return undef; +sub image_url { + ($user and $pass) or return; my $isbn = (@_ ? shift : ''); $isbn =~ s/(p|-)//g; # sanitize return $image_url . $isbn; } -sub link_url (;$) { +sub link_url { my $isbn = (@_ ? shift : ''); $isbn =~ s/(p|-)//g; # sanitize - $link_url or return undef; + $link_url or return; return $link_url . $isbn; } -sub content_cafe_url ($) { - ($user and $pass) or return undef; +sub content_cafe_url { + ($user and $pass) or return; my $isbn = (@_ ? shift : ''); $isbn =~ s/(p|-)//g; # sanitize return "http://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=$user&Password=$pass&Options=Y&ItemKey=$isbn"; } -sub http_jacket_link ($) { - my $isbn = shift or return undef; +sub http_jacket_link { + my $isbn = shift or return; $isbn =~ s/(p|-)//g; # sanitize my $image = availability($isbn); my $alt = "Buy this book"; @@ -79,9 +79,9 @@ sub http_jacket_link ($) { return sprintf qq(%s),$link,($image||$alt); } -sub availability ($) { - my $isbn = shift or return undef; - ($user and $pass) or return undef; +sub availability { + my $isbn = shift or return; + ($user and $pass) or return; $isbn =~ s/(p|-)//g; # sanitize my $url = "http://contentcafe2.btol.com/ContentCafe/InventoryAvailability.asmx/CheckInventory?UserID=$user&Password=$pass&Value=$isbn"; $debug and warn __PACKAGE__ . " request:\n$url\n"; -- 2.39.5