From dcb7a0a2ba8b88e89a3047ce200d4e23f72f5ad4 Mon Sep 17 00:00:00 2001 From: Mason James Date: Wed, 27 Jun 2012 02:28:26 +1200 Subject: [PATCH] Bug 6679 - fix 4 perlcritic violations in C4/Creators/PDF.pm Content-Type: text/plain; charset="utf-8" http://koha-community.org - "return" statement with explicit "undef" at line 171, column 8. See page 199 of PBP. (Severity: 5) - "return" statement with explicit "undef" at line 201, column 8. See page 199 of PBP. (Severity: 5) - Bareword file handle opened at line 212, column 11. See pages 202,204 of PBP. (Severity: 5) - Two-argument "open" used at line 212, column 11. See page 207 of PBP. (Severity: 5) --- C4/Creators/PDF.pm | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/C4/Creators/PDF.pm b/C4/Creators/PDF.pm index 41ff548..871e32b 100644 --- a/C4/Creators/PDF.pm +++ b/C4/Creators/PDF.pm @@ -168,7 +168,7 @@ sub prAltJpeg { my ($iData, $iWidth, $iHeight, $iFormat,$aiData, $aiWidth, $aiHeight, $aiFormat) = @_; my ($namnet, $utrad); if (! $PDF::Reuse::pos) # If no output is active, it is no use to continue - { return undef; + { return; } prJpegBlob($aiData, $aiWidth, $aiHeight, $aiFormat); my $altObjNr = $PDF::Reuse::objNr; @@ -198,7 +198,7 @@ sub prJpegBlob { my ($iData, $iWidth, $iHeight, $iFormat, $altArrayObjNr) = @_; my ($iLangd, $namnet, $utrad); if (! $PDF::Reuse::pos) # If no output is active, it is no use to continue - { return undef; + { return; } my $checkidOld = $PDF::Reuse::checkId; if (!$iFormat) @@ -209,16 +209,16 @@ sub prJpegBlob $namnet = 'Ig' . $PDF::Reuse::imageNr; $PDF::Reuse::objNr++; $PDF::Reuse::objekt[$PDF::Reuse::objNr] = $PDF::Reuse::pos; - open (BILDFIL, "<$iFile") || errLog("Couldn't open $iFile, $!, aborts"); - binmode BILDFIL; + open (my $fh, '<', "$iFile") || errLog("Couldn't open $iFile, $!, aborts"); + binmode $fh; my $iStream; - sysread BILDFIL, $iStream, $iLangd; + sysread $fh, $iStream, $iLangd; $utrad = "$PDF::Reuse::objNr 0 obj\n<>stream\n$iStream\nendstream\nendobj\n"; - close BILDFIL; + close $fh; $PDF::Reuse::pos += syswrite $PDF::Reuse::UTFIL, $utrad; if ($PDF::Reuse::runfil) { $PDF::Reuse::log .= "Cid~$PDF::Reuse::checkId\n"; -- 1.7.2.5