]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix failure with perlcritic in psql's create_help.pl
authorMichael Paquier <michael@paquier.xyz>
Thu, 19 Jan 2023 01:02:15 +0000 (10:02 +0900)
committerMichael Paquier <michael@paquier.xyz>
Thu, 19 Jan 2023 01:02:15 +0000 (10:02 +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/K@paquier.xyz
Backpatch-through: 11

src/bin/psql/create_help.pl

index 08ed03215e57c03c8ced4566de69a9c671c0424a..d57bd4ba1d633dc3f9e18e9fd5b59959e6dc8439 100644 (file)
@@ -40,7 +40,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, '>', $hfile)
   or die "$0: could not open output file '$hfile': $!\n";
@@ -90,7 +90,7 @@ my $maxlen = 0;
 
 my %entries;
 
-foreach my $file (sort readdir DIR)
+foreach my $file (sort readdir $dh)
 {
        my (@cmdnames, $cmddesc, $cmdsynopsis);
        $file =~ /\.sgml$/ or next;
@@ -210,4 +210,4 @@ print $hfile_handle "
 
 close $cfile_handle;
 close $hfile_handle;
-closedir DIR;
+closedir $dh;