Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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;
>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.
>$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.



Attachment: plperl-strict2.patch
Description: text/x-patch (10.8 KB)

In response to


pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group