Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cspM6-0000x4-FV for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Mar 2017 11:32:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cspM6-00087v-1u for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Mar 2017 11:32:06 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cspM4-00082M-85 for pgsql-hackers@postgresql.org; Tue, 28 Mar 2017 11:32:04 +0000 Received: from ping.uio.no ([2001:700:100:570::196]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cspM1-00052C-LF for pgsql-hackers@postgresql.org; Tue, 28 Mar 2017 11:32:02 +0000 Received: from [2001:700:100:570::211] (helo=dalvik.ping.uio.no ident=Debian-exim) by ping.uio.no with esmtp (Exim 4.72 #1 (Debian)) id 1cspLt-0003Rc-P7; Tue, 28 Mar 2017 13:31:55 +0200 Received: from ilmari by dalvik.ping.uio.no with local (Exim 4.84_2) (envelope-from ) id 1cspLt-0004av-KQ; Tue, 28 Mar 2017 13:31:53 +0200 From: ilmari@ilmari.org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) To: Andrew Dunstan Cc: Tom Lane , Peter Eisentraut , pgsql-hackers@postgresql.org Subject: Re: [COMMITTERS] pgsql: Clean up Perl code according to perlcritic References: <14575.1490652977@sss.pgh.pa.us> <4193.1490662733@sss.pgh.pa.us> <88bc7984-f630-0629-e8f5-36211a31601c@2ndQuadrant.com> Mail-Copies-To: nobody Date: Tue, 28 Mar 2017 12:31:53 +0100 In-Reply-To: <88bc7984-f630-0629-e8f5-36211a31601c@2ndQuadrant.com> (Andrew Dunstan's message of "Tue, 28 Mar 2017 07:18:27 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Exiscan-Spam-Score: -3.7 (---) X-Exiscan-Spam-Report: SpamAssassin 3.3.1 (2010-03-16) on pike.ping.uio.no Score Rule * -5.0 PING_UIO_MAIL_IS_INTERNAL Message has never been outside * 129.240.0.0/16 or 193.157.115.0/24 * 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Pg-Spam-Score: -4.2 (----) 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 Andrew Dunstan writes: > I would try something like this: > > @opts = grep { $_ !~ /\$\(/ && $_ =~ /^--/ } > map { s/\Q$(top_builddir)\E/\"$topdir\"/; } > split(/\s+/, $1); That map is not going to work: it'll modify the values returned by split(), but s/// (without the /r modifier, which was added in 5.14) returns the number of substitutions made, not the modified string. -- "The surreality of the universe tends towards a maximum" -- Skud's Law "Never formulate a law or axiom that you're not prepared to live with the consequences of." -- Skud's Meta-Law -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers