Re: syntax error in plperl wrapper for Perl regex replace.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "io(dot)sys" <io(dot)sys(at)post(dot)cz>
Cc: postgre novice mail list <pgsql-novice(at)postgresql(dot)org>
Subject: Re: syntax error in plperl wrapper for Perl regex replace.
Date: 2018-08-24 02:17:10
Message-ID: 26555.1535077030@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

"io.sys" <io(dot)sys(at)post(dot)cz> writes:
> I just tried to use function parameters $_[1], $_[2], $_[3] instead fixed strings.
> However, it is rejected by postgre as syntax error.

That's not a Postgres problem, it's a Perl problem. I'm no Perl
expert, but I think if you study the Perl docs carefully you will
find there are restrictions on what sorts of variable references
can be interpolated into a regexp ... and a subscripted reference
probably doesn't qualify.

regards, tom lane

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message io.sys 2018-08-24 23:55:47 Re: syntax error in plperl wrapper for Perl regex replace.
Previous Message io.sys 2018-08-24 01:32:49 Re: syntax error in plperl wrapper for Perl regex replace.