42
(1 row)
+-- verify that we can use $_SHARED in strict mode
+create or replace function perl_shared() returns int as $$
+use strict;
+my $val = $_SHARED{'stuff'};
+$_SHARED{'stuff'} = '1';
+return $val;
+$$ language plperl;
+select perl_shared();
+ perl_shared
+-------------
+
+(1 row)
+
+select perl_shared();
+ perl_shared
+-------------
+ 1
+(1 row)
+
-# $PostgreSQL: pgsql/src/pl/plperl/plc_perlboot.pl,v 1.6 2010/05/13 16:39:43 adunstan Exp $
+# $PostgreSQL: pgsql/src/pl/plperl/plc_perlboot.pl,v 1.6.2.1 2010/07/27 04:18:31 alvherre Exp $
use 5.008001;
+use vars qw(%_SHARED);
PostgreSQL::InServer::Util::bootstrap();
use strict;
use warnings;
-use vars qw(%_SHARED);
sub plperl_warn {
(my $msg = shift) =~ s/\(eval \d+\) //g;
select getme('ourkey');
select getme('on_init');
+
+-- verify that we can use $_SHARED in strict mode
+create or replace function perl_shared() returns int as $$
+use strict;
+my $val = $_SHARED{'stuff'};
+$_SHARED{'stuff'} = '1';
+return $val;
+$$ language plperl;
+
+select perl_shared();
+select perl_shared();