public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Paquier <[email protected]>
To: Postgres hackers <[email protected]>
Subject: Issue with psql's create_help.pl under perlcritic
Date: Wed, 18 Jan 2023 17:50:47 +0900
Message-ID: <Y8ey5z4Nav62g4/[email protected]> (raw)

Hi all,

A recent system update of a Debian SID host has begun to show me this
issue:
./src/bin/psql/create_help.pl: Bareword dir handle opened at line 47,
column 1.  See pages 202,204 of PBP.
([InputOutput::ProhibitBarewordDirHandles] Severity: 5)

This issue gets fixed here as of the attached.
Comments?
--
Michael


Attachments:

  [text/x-diff] psql_perlcritic.patch (864B, ../Y8ey5z4Nav62g4%[email protected]/2-psql_perlcritic.patch)
  download | inline diff:
diff --git a/src/bin/psql/create_help.pl b/src/bin/psql/create_help.pl
index 2c5fed203e..1d5366db16 100644
--- a/src/bin/psql/create_help.pl
+++ b/src/bin/psql/create_help.pl
@@ -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;


  [application/pgp-signature] signature.asc (833B, ../Y8ey5z4Nav62g4%[email protected]/3-signature.asc)
  download

view thread (2+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Issue with psql's create_help.pl under perlcritic
  In-Reply-To: <Y8ey5z4Nav62g4/[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox