Re: First feature patch for plperl - draft [PATCH] - Mailing list pgsql-hackers

From Tim Bunce
Subject Re: First feature patch for plperl - draft [PATCH]
Date
Msg-id 20091204191635.GA89699@timac.local
Whole thread Raw
In response to Re: First feature patch for plperl - draft [PATCH]  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, Dec 04, 2009 at 11:01:42AM -0500, 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.

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.


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: First feature patch for plperl - draft [PATCH]
Next
From: Tim Bunce
Date:
Subject: Re: Initial refactoring of plperl.c - rebased [PATCH]