X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=misc%2Fcheck_sysprefs.pl;h=aed792c9adba239d1f2434e0f0afa8b3a294e195;hb=9d6d641d1f8b77271800f43bc027b651f9aea52b;hp=91d007511eb47acaf4509feab431576100fa5473;hpb=ce037a96eb173e300a564ca96415d8c8bbe304b9;p=srvgit diff --git a/misc/check_sysprefs.pl b/misc/check_sysprefs.pl index 91d007511e..aed792c9ad 100755 --- a/misc/check_sysprefs.pl +++ b/misc/check_sysprefs.pl @@ -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 = ) { + 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();