Hello Nabil,
you worte at 2003-10-04T01:29:00:
> 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 ?
What I understand: You want to split some data into a pair of key
and value.
So, just do that:
($key, $val) = split(/=/, $data);
HTH.
cya :-)
Martin "vi"