Bug 33341: Address some perlcritic errors in 5.36
[srvgit] / admin / marc_subfields_structure.pl
index 2d10c41..8fe3462 100755 (executable)
@@ -111,19 +111,20 @@ if ( $op eq 'add_form' ) {
     # on a standard install, /cgi-bin need to be added.
     # test one, then the other
     my $cgidir = C4::Context->config('intranetdir') . "/cgi-bin";
-    unless ( opendir( DIR, "$cgidir/cataloguing/value_builder" ) ) {
+    my $dir_h;
+    unless ( opendir( $dir_h, "$cgidir/cataloguing/value_builder" ) ) {
         $cgidir = C4::Context->config('intranetdir');
-        opendir( DIR, "$cgidir/cataloguing/value_builder" )
+        opendir( $dir_h, "$cgidir/cataloguing/value_builder" )
           || die "can't opendir $cgidir/value_builder: $!";
     }
-    while ( my $line = readdir(DIR) ) {
+    while ( my $line = readdir($dir_h) ) {
         if ( $line =~ /\.pl$/ &&
              $line !~ /EXAMPLE\.pl$/ ) { # documentation purposes
             push( @value_builder, $line );
         }
     }
     @value_builder= sort {$a cmp $b} @value_builder;
-    closedir DIR;
+    closedir $dir_h;
 
     # build values list
     my $mss = Koha::MarcSubfieldStructures->search(