Fix failure with perlcritic in psql's create_help.pl
authorMichael Paquier <[email protected]>
Thu, 19 Jan 2023 01:01:53 +0000 (10:01 +0900)
committerMichael Paquier <[email protected]>
Thu, 19 Jan 2023 01:01:53 +0000 (10:01 +0900)
No buildfarm members have reported that yet, but a recently-refreshed
Debian host did.

Reviewed-by: Andrew Dunstan
Discussion: https://postgr.es/m/Y8ey5z4Nav62g4/[email protected]
Back-through: 11

src/bin/psql/create_help.pl

index 2c5fed203eb66be63fd4fcdf648ca50e267717e1..1d5366db16cf542c7f1fae5362e096a15870ca0f 100644 (file)
@@ -44,7 +44,7 @@ my $define = $hfilebasename;
 $define =~ tr/a-z/A-Z/;
 $define =~ s/\W/_/g;
 
-opendir(DIR, $docdir)
+opendir(my $dh, $docdir)
   or die "$0: could not open documentation source dir '$docdir': $!\n";
 open(my $hfile_handle, '>', "$outdir/$hfile")
   or die "$0: could not open output file '$hfile': $!\n";
@@ -103,7 +103,7 @@ my $maxlen = 0;
 
 my %entries;
 
-foreach my $file (sort readdir DIR)
+foreach my $file (sort readdir $dh)
 {
    my ($cmdid, @cmdnames, $cmddesc, $cmdsynopsis);
    $file =~ /\.sgml$/ or next;
@@ -230,4 +230,4 @@ print $hfile_handle "
 close $cfile_handle;
 close $hfile_handle;
 close $depfile_handle if ($depfile);
-closedir DIR;
+closedir $dh;