Andres Freund <[email protected]> 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 via email to