Make the plperl regression tests pass in 'use_strict' mode, by adding
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 24 Aug 2005 19:24:54 +0000 (19:24 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 24 Aug 2005 19:24:54 +0000 (19:24 +0000)
'my' where appropriate.  Michael Fuhr

src/pl/plperl/expected/plperl.out
src/pl/plperl/sql/plperl.sql

index 2ba89ea2c3eae3496a190818ee2d603f56729371..a2b34a78cbff79347c42fa213eba1d29c0df0f3d 100644 (file)
@@ -336,7 +336,7 @@ SELECT perl_get_field((11,12), 'z');
 -- Test return_next
 --
 CREATE OR REPLACE FUNCTION perl_srf_rn() RETURNS SETOF RECORD AS $$
-$i = 0;
+my $i = 0;
 for ("World", "PostgreSQL", "PL/Perl") {
     return_next({f1=>++$i, f2=>'Hello', f3=>$_});
 }
@@ -354,8 +354,8 @@ SELECT * from perl_srf_rn() AS (f1 INTEGER, f2 TEXT, f3 TEXT);
 -- Test spi_query/spi_fetchrow
 --
 CREATE OR REPLACE FUNCTION perl_spi_func() RETURNS SETOF INTEGER AS $$
-$x = spi_query("select 1 as a union select 2 as a");
-while (defined ($y = spi_fetchrow($x))) {
+my $x = spi_query("select 1 as a union select 2 as a");
+while (defined (my $y = spi_fetchrow($x))) {
     return_next($y->{a});
 }
 return;
index c274659e7c4415c760e9eef434ddaa714920e642..e6fc5c35ddee02268cb20473b978a507523b10ce 100644 (file)
@@ -240,7 +240,7 @@ SELECT perl_get_field((11,12), 'z');
 --
 
 CREATE OR REPLACE FUNCTION perl_srf_rn() RETURNS SETOF RECORD AS $$
-$i = 0;
+my $i = 0;
 for ("World", "PostgreSQL", "PL/Perl") {
     return_next({f1=>++$i, f2=>'Hello', f3=>$_});
 }
@@ -253,8 +253,8 @@ SELECT * from perl_srf_rn() AS (f1 INTEGER, f2 TEXT, f3 TEXT);
 --
 
 CREATE OR REPLACE FUNCTION perl_spi_func() RETURNS SETOF INTEGER AS $$
-$x = spi_query("select 1 as a union select 2 as a");
-while (defined ($y = spi_fetchrow($x))) {
+my $x = spi_query("select 1 as a union select 2 as a");
+while (defined (my $y = spi_fetchrow($x))) {
     return_next($y->{a});
 }
 return;