Re: pl/perl function life and variable scope - concurrency problem? - Mailing list pgsql-general

From Doug McNaught
Subject Re: pl/perl function life and variable scope - concurrency problem?
Date
Msg-id 87fzgtwceh.fsf@asmodeus.mcnaught.org
Whole thread Raw
In response to pl/perl function life and variable scope - concurrency problem?  (Christopher Murtagh <christopher.murtagh@mcgill.ca>)
Responses Re: pl/perl function life and variable scope - concurrency
List pgsql-general
Christopher Murtagh <christopher.murtagh@mcgill.ca> writes:

>  Thanks to a lot of help on this list, I've managed to get my pl/perl
> function working. However, I have an unexpected result. Here's a simple
> way to reproduce this problem:
>
> CREATE or REPLACE FUNCTION perltest(integer)
> returns integer as '
>   $MyInt = $MyInt + 1;
>   return $MyInt;
> ' language plperlu;

There's a reason Perl has "my" variables.  Use them.  ;)

-Doug

pgsql-general by date:

Previous
From: Doug McNaught
Date:
Subject: Re: Column Sizes
Next
From: Doug McNaught
Date:
Subject: Re: SQL-question: returning the id of an insert querry