From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: pgsql-hackers@postgresql.org
Subject: Re: [COMMITTERS] pgsql: Clean up Perl code according to perlcritic
Date: Mon, 27 Mar 2017 20:58:53 -0400
Message-ID: <4193.1490662733@sss.pgh.pa.us> (raw)
In-Reply-To: <14575.1490652977@sss.pgh.pa.us>
References: <E1csTgB-0003xZ-3P@gemulon.postgresql.org>
<14575.1490652977@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
I wrote:
> Peter Eisentraut <peter_e@gmx.net> 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
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us, peter_e@gmx.net, pgsql-hackers@postgresql.org
Subject: Re: [COMMITTERS] pgsql: Clean up Perl code according to perlcritic
In-Reply-To: <4193.1490662733@sss.pgh.pa.us>
References: <E1csTgB-0003xZ-3P@gemulon.postgresql.org> <14575.1490652977@sss.pgh.pa.us> <4193.1490662733@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