[Koha-patches] [SIGNED OFF 1/2] Bug 5611 INIT block causes failure with mod perl

Colin Campbell colin.campbell at ptfs-europe.com
Wed Jan 12 17:53:21 CET 2011


From: Bryce Sanchez <brice.sanchez at sys-tech.net>

Per module INIT Blocks are not run in mod_perl so their
variables are not visible. A lexical var is adequate
for this purpose

Signed-off-by: Colin Campbell <colin.campbell at ptfs-europe.com>
---
 C4/Scrubber.pm |   25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/C4/Scrubber.pm b/C4/Scrubber.pm
index 80e08e5..d01795a 100644
--- a/C4/Scrubber.pm
+++ b/C4/Scrubber.pm
@@ -30,19 +30,18 @@ BEGIN {
 	# @ISA = qw(HTML::Scrubber);
 }
 
-INIT {
-	%scrubbertypes = (
-		default => {},	# place holder, default settings are below as fallbacks in call to constructor
-		    tag => {},	# uses defaults
-		comment => {
-			allow   => [qw( br b i em big small strong )],
-		},
-		staff   => {
-			default => [ 1 =>{'*'=>1} ],
-			comment => 1,
-		},
-	);
-}
+
+my %scrubbertypes = (
+	default => {},	# place holder, default settings are below as fallbacks in call to constructor
+	    tag => {},	# uses defaults
+	comment => {
+	allow   => [qw( br b i em big small strong )],
+	},
+	staff   => {
+	default => [ 1 =>{'*'=>1} ],
+	comment => 1,
+	},
+);
 
 
 sub new {
-- 
1.7.3.4



More information about the Koha-patches mailing list