PlPerl scope issue

From: "Peter" <peter(at)greatnowhere(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: PlPerl scope issue
Date: 2009-12-15 14:35:21
Message-ID: 019f01ca7d93$d8fdb2d0$8af91870$@com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

After upgrade to 8.4.1 Perl "my" variables are no longer being seen by
subroutines:

CREATE OR REPLACE FUNCTION global.perl_test()

RETURNS "varchar" AS

$BODY$

my $test="x";

test();

return $test;

sub test {

elog(NOTICE,"X=".$test);

}

$BODY$

language 'plperlu';

Now, "select global.perl_test()" returns "x" but the value is missing from
notice statement. This worked just fine in 8.3, and Perl scoping rules say
'my' variables are visible by subroutines within the same code block. I'm
running Ubuntu Karmic, installed from stock PG repositories. Whats going on
here?

Peter

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tim Bunce 2009-12-15 15:32:47 Re: PlPerl scope issue
Previous Message Scott Mead 2009-12-15 14:10:15 Re: Too many postgres.exe