Hello again,
now that perlsub works i need to know how backreferences work with
plperl. $1 - $9 doesn't work. Any idea ?
perlsub:
-----------------------------------------------
CREATE FUNCTION perlsub(text, text, text) RETURNS text AS '
my ($data, $pat, $repl) = @_;
$data =~ s/$pat/$repl/;
return $data
' LANGUAGE 'plperl';
-----------------------------------------------
SELECT perlsub('a=b','([^=]+)=(.+)','key:$1;val:$2');
Any idea ? Just a matter of quoting ?
Also this example doesn't work with * instead of + :(
TIA
--
e-Trolley Sayegh & John, Nabil Sayegh
Tel.: 0700 etrolley /// 0700 38765539
Fax.: +49 69 8299381-8
PGP : http://www.e-trolley.de