From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Andres Freund <andres(at)anarazel(dot)de> |
Cc: | pgsql-committers(at)lists(dot)postgresql(dot)org, Andrew Dunstan <andrew(at)dunslane(dot)net> |
Subject: | Re: pgsql: ecpg: Output dir, source dir, stamp file argument for preproc/*. |
Date: | 2022-07-18 21:27:21 |
Message-ID: | 822625.1658179641@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Andres Freund <andres(at)anarazel(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Andres Freund | 2022-07-18 21:50:42 | Re: pgsql: ecpg: Output dir, source dir, stamp file argument for preproc/*. |
Previous Message | Tom Lane | 2022-07-18 21:14:32 | Re: pgsql: ecpg: Output dir, source dir, stamp file argument for preproc/*. |