Re: PL/Perl regression tests with use_strict

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: pgsql-patches(at)postgresql(dot)org
Cc: mike(at)fuhr(dot)org, tgl(at)sss(dot)pgh(dot)pa(dot)us
Subject: Re: PL/Perl regression tests with use_strict
Date: 2005-08-24 13:50:06
Message-ID: 430C7B0E.2050805@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

I wrote:

>Michael Fuhr said:
>
>
>>we might be able to do
>>
>> my $retval = eval($stuff);
>> $@ =~ s/ \(eval \d+\) / /g if $@;
>> return $retval;
>>
>>T
>>
>It would probably be more efficient and less convoluted to munge this in a
>__DIE__ handler. The we wouldn't need the extra level of eval.
>
>e.g.
>
>$SIG{__DIE__} =
> sub { my $msg = $_[0]; $msg =~ s/\(eval \d+\) //; die $msg; };
>
>
>
>

Or rather it would do if we didn't carefully avoid the die handler so we
can get our hands on the message.

Here's an updated patch incorporating Michael's ideas, and this time
*with* a small regression test that dynamically turns strict mode on/off.

cheers

andrew

Attachment Content-Type Size
plperl-strict2.patch text/x-patch 10.8 KB

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2005-08-24 14:08:41 Re: PATCH to allow concurrent VACUUMs to not lock each
Previous Message Bruce Momjian 2005-08-24 12:49:15 Re: ECPG and escape strings