Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDYH4-0007YI-Ll for pgsql-committers@arkaria.postgresql.org; Mon, 18 Jul 2022 21:27:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oDYH2-0003Xc-5M for pgsql-committers@arkaria.postgresql.org; Mon, 18 Jul 2022 21:27:28 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDYH1-0003XT-VG for pgsql-committers@lists.postgresql.org; Mon, 18 Jul 2022 21:27:27 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oDYGz-00043u-Fw for pgsql-committers@lists.postgresql.org; Mon, 18 Jul 2022 21:27:26 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 26ILRLdh822626; Mon, 18 Jul 2022 17:27:22 -0400 From: Tom Lane To: Andres Freund cc: pgsql-committers@lists.postgresql.org, Andrew Dunstan Subject: Re: pgsql: ecpg: Output dir, source dir, stamp file argument for preproc/*. In-reply-to: <20220718211408.o2uyu5kvud56ihlj@awork3.anarazel.de> References: <20220718211408.o2uyu5kvud56ihlj@awork3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Mon, 18 Jul 2022 14:14:08 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <822624.1658179641.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 18 Jul 2022 17:27:21 -0400 Message-ID: <822625.1658179641@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > Jul 18 16:48:25 ./src/interfaces/ecpg/preproc/parse.pl: Bareword file ha= ndle opened at line 30, column 1. See pages 202,204 of PBP. ([InputOutpu= t::ProhibitBarewordFileHandles] Severity: 5) > Jul 18 16:48:25 ./src/interfaces/ecpg/preproc/parse.pl: Bareword file ha= ndle opened at line 31, column 1. See pages 202,204 of PBP. ([InputOutpu= t::ProhibitBarewordFileHandles] Severity: 5) > afaict that's bogus. It's unnecessary that the code uses "our" instead o= f > "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 th= at it is only valid within a lexical scope. Unlike "my" and "stat= e", which both declare new (lexical) variables, "our" only creates = an alias to an existing variable: a package variable of the same n= ame. 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