PlPerl scope issue - Mailing list pgsql-general

From Peter
Subject PlPerl scope issue
Date
Msg-id 019f01ca7d93$d8fdb2d0$8af91870$@com
Whole thread Raw
Responses Re: PlPerl scope issue
List 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

 

pgsql-general by date:

Previous
From: Scott Mead
Date:
Subject: Re: Too many postgres.exe
Next
From: Tim Bunce
Date:
Subject: Re: PlPerl scope issue