ecpg: use our instead of my in parse.pl to fix perlcritic complaint
authorAndres Freund <[email protected]>
Mon, 18 Jul 2022 21:53:02 +0000 (14:53 -0700)
committerAndres Freund <[email protected]>
Mon, 18 Jul 2022 21:53:02 +0000 (14:53 -0700)
In db0a272d123 I used open(our $something, ...), which perlcritic doesn't
like. It looks like the warning is due to perlcritic knowing about 'my' but
not 'our' when checking for bareword file handles.

However, it's clearly unnecessary to use "our" here, change it to "my".

Via buildfarm member crake and discussion with Tom Lane.

Discussion: https://postgr.es/m/20220718215042[email protected]

src/interfaces/ecpg/preproc/parse.pl

index a15f563ad45761f163f8b1b9ba88cf80c9e39b3c..8fb2224249222692e4fb1d752d803fcd3abb5dc7 100644 (file)
@@ -27,8 +27,8 @@ GetOptions(
    'parser=s' => \$parser,) or die "wrong arguments";
 
 # open parser / output file early, to raise errors early
-open(our $parserfh, '<', $parser) or die "could not open parser file $parser";
-open(our $outfh, '>', $outfile) or die "could not open output file $outfile";
+open(my $parserfh, '<', $parser) or die "could not open parser file $parser";
+open(my $outfh, '>', $outfile) or die "could not open output file $outfile";
 
 my $copymode              = 0;
 my $brace_indent          = 0;