Re: PL/Perl embedding string common elements - Mailing list pgsql-patches

From Andrew Dunstan
Subject Re: PL/Perl embedding string common elements
Date
Msg-id 4307EBBC.1090700@dunslane.net
Whole thread Raw
In response to Re: PL/Perl embedding string common elements  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: PL/Perl embedding string common elements  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches

Tom Lane wrote:

>Andrew Dunstan <andrew@dunslane.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

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: PL/Perl embedding string common elements
Next
From: Tom Lane
Date:
Subject: Re: PL/Perl embedding string common elements