Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1csfUw-0008Ae-Bw for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Mar 2017 01:00:34 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1csfUv-0002C6-Uw for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Mar 2017 01:00:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1csfTP-0005KI-R0 for pgsql-hackers@postgresql.org; Tue, 28 Mar 2017 00:58:59 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1csfTN-00077M-HX for pgsql-hackers@postgresql.org; Tue, 28 Mar 2017 00:58:59 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v2S0wr2n004194; Mon, 27 Mar 2017 20:58:53 -0400 From: Tom Lane To: Peter Eisentraut cc: pgsql-hackers@postgresql.org Subject: Re: [COMMITTERS] pgsql: Clean up Perl code according to perlcritic In-reply-to: <14575.1490652977@sss.pgh.pa.us> References: <14575.1490652977@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Mon, 27 Mar 2017 18:16:17 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4192.1490662733.1@sss.pgh.pa.us> Date: Mon, 27 Mar 2017 20:58:53 -0400 Message-ID: <4193.1490662733@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org I wrote: > Peter Eisentraut writes: >> Clean up Perl code according to perlcritic > This seems to have broken the regression tests (specifically, dblink) > on at least some of the Windows buildfarm critters. I'm hardly a Perl expert, but it looks to me like the culprit is this hunk in vcregress.pl: @@ -521,8 +521,9 @@ sub fetchRegressOpts # an unhandled variable reference. Ignore anything that isn't an # option starting with "--". @opts = grep { - s/\Q$(top_builddir)\E/\"$topdir\"/; - $_ !~ /\$\(/ && $_ =~ /^--/ + my $x = $_; + $x =~ s/\Q$(top_builddir)\E/\"$topdir\"/; + $x !~ /\$\(/ && $x =~ /^--/ } split(/\s+/, $1); } if ($m =~ /^\s*ENCODING\s*=\s*(\S+)/m) The first line in that block is actually intending to modify the value it's inspecting, and perlcritic's "improved" version carefully removes the side-effect. No doubt there are cleaner ways to do that (the comments in "man perlfunc" about this coding technique are not positive), but this way is not cleaner, it is broken. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers