From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-committers@lists.postgresql.org, Andrew Dunstan <andrew@dunslane.net>
Subject: Re: pgsql: ecpg: Output dir, source dir, stamp file argument for preproc/*.
Date: Mon, 18 Jul 2022 17:27:21 -0400
Message-ID: <822625.1658179641@sss.pgh.pa.us> (raw)
In-Reply-To: <20220718211408.o2uyu5kvud56ihlj@awork3.anarazel.de>
References: <E1oDWqn-000ADD-Oh@gemulon.postgresql.org>
<20220718211408.o2uyu5kvud56ihlj@awork3.anarazel.de>
Andres Freund <andres@anarazel.de> writes:
> Jul 18 16:48:25 ./src/interfaces/ecpg/preproc/parse.pl: Bareword file handle opened at line 30, column 1. See pages 202,204 of PBP. ([InputOutput::ProhibitBarewordFileHandles] Severity: 5)
> Jul 18 16:48:25 ./src/interfaces/ecpg/preproc/parse.pl: Bareword file handle opened at line 31, column 1. See pages 202,204 of PBP. ([InputOutput::ProhibitBarewordFileHandles] Severity: 5)
> afaict that's bogus. It's unnecessary that the code uses "our" instead of
> "my", but there's no bareword there and replacing our with my fixes that
> complaint.
Ah, I think I've got it. Per "man perlfunc":
"our" has the same scoping rules as "my" or "state", meaning that
it is only valid within a lexical scope. Unlike "my" and "state",
which both declare new (lexical) variables, "our" only creates an
alias to an existing variable: a package variable of the same name.
Since there's not actually any such package variable, the net effect is
that the first argument of open() is an undeclared name. I can more or
less see why perl might treat that the same as a bareword, though I
definitely agree that this error message is more confusing than helpful.
regards, tom lane
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: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, andrew@dunslane.net
Subject: Re: pgsql: ecpg: Output dir, source dir, stamp file argument for preproc/*.
In-Reply-To: <822625.1658179641@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox