Bug 32336: (QA follow-up) Use $metadata->schema
[srvgit] / misc / check_sysprefs.pl
index 91d0075..aed792c 100755 (executable)
@@ -8,8 +8,9 @@
 use strict;
 use warnings;
 
-use File::Find;
+use File::Find qw( find );
 
+use Koha::Script;
 use C4::Context;
 
 @ARGV = qw(.) unless @ARGV;
@@ -21,8 +22,8 @@ sub check_sys_pref {
     if ( !-d _ ) {
         my $name = $File::Find::name;
         if ( $name =~ /(\.pl|\.pm)$/ ) {
-            open( FILE, "$_" ) || die "cant open $name";
-            while ( my $inp = <FILE> ) {
+            open( my $fh, '<', $_ ) || die "can't open $name";
+            while ( my $inp = <$fh> ) {
                 if ( $inp =~ /C4::Context->preference\((.*?)\)/ ) {
                     my $variable = $1;
                     $variable =~ s /\'|\"//g;
@@ -36,7 +37,7 @@ sub check_sys_pref {
 "$name has a reference to $variable, this does not exist in the database\n";
                 }
             }
-            close FILE;
+            close $fh;
         }
     }
     $sth->finish();