Re: First feature patch for plperl - draft [PATCH]

From: Tim Bunce <Tim(dot)Bunce(at)pobox(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jeff <threshar(at)threshar(dot)is-a-geek(dot)com>, Tim Bunce <Tim(dot)Bunce(at)pobox(dot)com>, "David E(dot) Wheeler" <david(at)kineticode(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: First feature patch for plperl - draft [PATCH]
Date: 2009-12-04 19:16:36
Message-ID: 20091204191635.GA89699@timac.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Dec 04, 2009 at 11:01:42AM -0500, Tom Lane wrote:
> Jeff <threshar(at)threshar(dot)is-a-geek(dot)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.

Finding a solution is definitely on my list. I've spent a little time
exploring this already but haven't found a simple solution yet.

The neatest would have been overriding &CORE::GLOBAL::require but sadly
the Safe/Opcode mechanism takes priority over that and forbids compiling
code that does a use/require.

I may end up re-enabling the require opcode but redirecting it to run
some C code in plperl.c (the same 'opcode redirection' technique used by
my NYTProf profiler). That C code would only need to throw an exception
if the module hasn't been loaded already.

Tim.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tim Bunce 2009-12-04 19:19:28 Re: Initial refactoring of plperl.c - rebased [PATCH]
Previous Message Robert Haas 2009-12-04 19:13:28 Re: First feature patch for plperl - draft [PATCH]