From 2b817cc1205a00924034d7aafbc120a5290d2cbd Mon Sep 17 00:00:00 2001 From: Mason James Date: Wed, 27 Jun 2012 02:28:26 +1200 Subject: [PATCH] Bug 6679 - [SIGNED-OFF] fix 4 perlcritic violations in C4/Creators/PDF.pm - "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) Signed-off-by: Jonathan Druart --- C4/Creators/PDF.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/C4/Creators/PDF.pm b/C4/Creators/PDF.pm index 41ff54883a..871e32bd87 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"; -- 2.39.5