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

Re: PL/Perl embedding string common elements

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Michael Fuhr <mike(at)fuhr(dot)org>, pgsql-patches(at)postgresql(dot)org
Subject: Re: PL/Perl embedding string common elements
Date: 2005-08-21 02:49:32
Message-ID: 4307EBBC.1090700@dunslane.net (view raw or flat)
Thread:
Lists: pgsql-patches

Tom Lane wrote:

>Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>  
>
>>Every perl module whose author wants strict mode (and they all should) 
>>has to carry such a declaration, so in a sense we'd just be doing what 
>>perl itself does, and by trying to provide a global switch we're being 
>>unperlish.
>>    
>>
>
>You missed my point.  I wasn't objecting to having the global switch,
>only to the fact that turning it on and off doesn't do what a rational
>person would expect.  If it's going to advertise itself as USERSET then
>it darn well ought to be settable.
>
>The idea of loading the strict module unconditionally seems ok to me,
>if we can work out a way of making it apply or not apply to individual
>function compilations.  From what you were saying, perhaps it would
>work to implicitly add "strict->import();" when use_strict is enabled?
>
>	
>  
>

I am pretty sure we could load it unconditionally without disturbing 
anything (because of the scope rules), and then import it appropriately.

Do you expect turning it on to affect only future compilations? Or 
should we recompile every function already compiled in the present 
backend? I can see arguments either way. What about if we turn it off? 
In theory, anything that works with it turned on should work fine with 
it turned off, although the reverse is not true of course ...

And yes, you're right, we could have 4 functions instead of two: 
{safe,unsafe} x {strict, unstrict}.

cheers

andrew

In response to

Responses

pgsql-patches by date

Next:From: Tom LaneDate: 2005-08-21 03:11:33
Subject: Re: PL/Perl embedding string common elements
Previous:From: Tom LaneDate: 2005-08-21 02:29:37
Subject: Re: PL/Perl embedding string common elements

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