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: 430C7B0E.2050805@dunslane.net (view raw or flat)
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: plperl-strict2.patch
Description: text/x-patch (10.8 KB)

In response to

Responses

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-2014 The PostgreSQL Global Development Group