Re: [COMMITTERS] pgsql: Clean up Perl code according to perlcritic - Mailing list pgsql-hackers

From ilmari@ilmari.org (Dagfinn Ilmari Mannsåker)
Subject Re: [COMMITTERS] pgsql: Clean up Perl code according to perlcritic
Date
Msg-id d8jinmtvdqu.fsf@dalvik.ping.uio.no
Whole thread Raw
Responses Re: [COMMITTERS] pgsql: Clean up Perl code according to perlcritic  (Andrew Dunstan <andrew.dunstan@2ndquadrant.com>)
List pgsql-hackers
Andrew Dunstan <andrew.dunstan@2ndquadrant.com> 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 withthe consequences of."
--Skud's Meta-Law
 



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: [COMMITTERS] pgsql: Clean up Perl code according toperlcritic
Next
From: Andrew Dunstan
Date:
Subject: Re: [COMMITTERS] pgsql: Clean up Perl code according to perlcritic