Re: First feature patch for plperl - draft [PATCH]
Andrew Dunstan <andrew@dunslane.net>
From: Andrew Dunstan <andrew@dunslane.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Jeff <threshar@threshar.is-a-geek.com>, Tim Bunce <Tim.Bunce@pobox.com>, "David E. Wheeler" <david@kineticode.com>, pgsql-hackers@postgresql.org
Date: 2009-12-04T18:44:57Z
Lists: pgsql-hackers
Tom Lane wrote:
> Jeff <threshar@threshar.is-a-geek.com> writes:
>
>> Is there any possible way to enable "use strict;" for plperl (trusted)
>> modules?
>>
>
> The plperl manual shows a way to do it using some weird syntax or
> other. It'd sure be nice to be able to use the regular syntax though.
>
>
>
As is documented, all you have to do is have:
custom_variable_classes = 'plperl'
plperl.use_strict = 'true'
in your config. You only need to put the documented BEGIN block in your
function body if you want to do use strict mode on a case by case basis.
We can't allow an unrestricted "use strict;" in plperl functions because
it invokes an operation (require) that Safe.pm rightly regards as unsafe.
cheers
andrew