From 769d84d5059a0d35d470a01a777be66a7041a7e8 Mon Sep 17 00:00:00 2001 From: Mason James Date: Wed, 27 Jun 2012 02:20:58 +1200 Subject: [PATCH 1/1] Bug 6679 - [SIGNED-OFF] fix 4 perlcritic violations in C4/Installer.pm - Bareword file handle opened at line 157, column 13. See pages 202,204 of PBP. (Severity: 5) - I/O layer ":utf8" used at line 157, column 13. Use ":encoding(UTF-8)" to get strict validation. (Severity: 5) Signed-off-by: Jonathan Druart http://perldoc.perl.org/functions/open.html open(my $fh, "<:encoding(UTF-8)", "filename") || die "can't open UTF-8 encoded filename: $!"; --- C4/Installer.pm | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/C4/Installer.pm b/C4/Installer.pm index c1f356f..304698e 100644 --- a/C4/Installer.pm +++ b/C4/Installer.pm @@ -154,8 +154,8 @@ sub marc_framework_sql_list { my @frameworklist; map { my $name = substr( $_, 0, -4 ); - open FILE, "<:utf8","$dir/$requirelevel/$name.txt"; - my $lines = ; + open my $fh, "<:encoding(UTF-8)", "$dir/$requirelevel/$name.txt"; + my $lines = <$fh>; $lines =~ s/\n|\r/
/g; use utf8; utf8::encode($lines) unless ( utf8::is_utf8($lines) ); @@ -232,8 +232,8 @@ sub sample_data_sql_list { my @frameworklist; map { my $name = substr( $_, 0, -4 ); - open FILE, "<:utf8","$dir/$requirelevel/$name.txt"; - my $lines = ; + open my $fh , "<:encoding(UTF-8)", "$dir/$requirelevel/$name.txt"; + my $lines = <$fh>; $lines =~ s/\n|\r/
/g; use utf8; utf8::encode($lines) unless ( utf8::is_utf8($lines) ); -- 1.7.7.3