diff --git a/src/bin/psql/create_help.pl b/src/bin/psql/create_help.pl index 1a9836cbcc0..78ab2ffb622 100644 --- a/src/bin/psql/create_help.pl +++ b/src/bin/psql/create_help.pl @@ -41,7 +41,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"; @@ -93,7 +93,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; @@ -216,4 +216,4 @@ print $hfile_handle " close $cfile_handle; close $hfile_handle; -closedir DIR; +closedir $dh;