eliminate a bareword filehandle
authorSteve Hancock <perltidy@users.sourceforge.net>
Sat, 22 May 2021 00:37:04 +0000 (17:37 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sat, 22 May 2021 00:37:04 +0000 (17:37 -0700)
lib/Perl/Tidy.pm

index a5ab357208d1ca95f40053e51e05bab4c6c1b66b..d785497fbd0a77ccb07a81e4cae732176754c6d8 100644 (file)
@@ -901,10 +901,11 @@ EOM
                     if ( $input_file =~ /^\'(.+)\'$/ ) { $input_file = $1 }
                     if ( $input_file =~ /^\"(.+)\"$/ ) { $input_file = $1 }
                     my $pattern = fileglob_to_re($input_file);
-                    if ( opendir( DIR, './' ) ) {
+                    my $dh;
+                    if ( opendir( $dh, './' ) ) {
                         my @files =
-                          grep { /$pattern/ && !-d $_ } readdir(DIR);
-                        closedir(DIR);
+                          grep { /$pattern/ && !-d $_ } readdir($dh);
+                        closedir($dh);
                         if (@files) {
                             unshift @ARGV, @files;
                             next;