Re: pl/perl function life and variable scope - concurrency problem?

From: Doug McNaught <doug(at)mcnaught(dot)org>
To: Christopher Murtagh <christopher(dot)murtagh(at)mcgill(dot)ca>
Cc: postgres general <pgsql-general(at)postgresql(dot)org>
Subject: Re: pl/perl function life and variable scope - concurrency problem?
Date: 2003-11-12 20:38:14
Message-ID: 87fzgtwceh.fsf@asmodeus.mcnaught.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Christopher Murtagh <christopher(dot)murtagh(at)mcgill(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Doug McNaught 2003-11-12 20:41:34 Re: SQL-question: returning the id of an insert querry
Previous Message Doug McNaught 2003-11-12 20:36:49 Re: Column Sizes