From 3c2a9e9155e99d0c469967b854f1e0fb2860911a Mon Sep 17 00:00:00 2001 From: Mason James Date: Wed, 27 Jun 2012 02:20:58 +1200 Subject: [PATCH] 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: $!"; Signed-off-by: Paul Poulain --- C4/Installer.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/C4/Installer.pm b/C4/Installer.pm index c1f356f19c..304698ed0e 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) ); -- 2.39.5