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

plperl strict mode and associated fixes

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: plperl strict mode and associated fixes
Date: 2005-08-24 01:12:10
Message-ID: 430BC96A.5080703@dunslane.net (view raw or flat)
Thread:
Lists: pgsql-patches
The attached patch completes (I hope) the work begun by Michael Fuhr in 
an earlier unapplied patch, and makes strict mode work as recently 
discussed. I moved the embedded strings out of the calling functions 
into global macros to try to make the code a little more readable.

Unfortunately we can't have regression tests for this because it relies 
on a custom variable class.

Illustration of use:

andrew=# set plperl.use_strict = 'true';
SET
andrew=# create function foo() returns text language plperlu as $$ 
$foo=1; return 'foo';$$;
ERROR:  creation of Perl function failed: Global symbol "$foo" requires 
explicit package name at (eval 1) line 1.
andrew=# set plperl.use_strict = 'false';
SET
andrew=# create function foo() returns text language plperlu as $$ 
$foo=1; return 'foo';$$;
CREATE FUNCTION


cheers

andrew

Attachment: plperl-strict.patch
Description: text/x-patch (7.9 KB)

Responses

pgsql-patches by date

Next:From: Michael FuhrDate: 2005-08-24 02:22:28
Subject: Re: PL/Perl regression tests with use_strict
Previous:From: Bruce MomjianDate: 2005-08-23 23:38:45
Subject: Re: enable/disable trigger (Re: Fwd: [HACKERS] Open items)

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