Re: MSVC build broken with perl 5.10 - Mailing list pgsql-hackers

From Zeugswetter Andreas OSB SD
Subject Re: MSVC build broken with perl 5.10
Date
Msg-id E1539E0ED7043848906A8FF995BDA57902F90E24@m0143.s-mxs.net
Whole thread Raw
In response to MSVC build broken with perl 5.10  (Magnus Hagander <magnus@hagander.net>)
Responses Re: MSVC build broken with perl 5.10  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Magnus Hagander wrote:
> I just tried the MSVC build on a system with ActiveState Perl 5.10,
and
> it doesn't work. Some quick debugging before I downgraded to 5.8
showed
> that this regexp in Project.pm line 262:
>     my $replace_re = qr{^([^:\n\$]+\.c)\s*:\s*(?:%\s*:
)?\$(\([^\)]+\))\/(.*)\/[^\/]+$};
>
> matches things properly using Perl 5.8 in for example
> src/bin/initdb/Makefile (matches a total of around 10 Makefiles), but
> in 5.10 it simply does not match anything...
>
> Any perl guru out there who can comment on why? ;-)

The answer is actually simple, the \n needs the multiline modifier,
and thus the m needs to be part of the quote-like operator.

The perl doc states:
    "This operator quotes (and possibly compiles) its STRING"
(it seems 5.8 did not compile, but 5.10 does)

I feel that it is rather not a perl bug, and that the modifiers need to
be put
on the qr{}. I do not quite see why this re needs to be multiline in the
first place,
but I have not touched that in the attached patch, that is ready to
apply.
(modification works in perl 5.6, 5.8, 5.10)

Andreas

Attachment

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: pulling libpqtypes from queue
Next
From: "Merlin Moncure"
Date:
Subject: Re: pulling libpqtypes from queue