Subject | Re: [IB-Architect] Database names: Hair trigger |
---|---|
Author | Bill Karwin |
Post date | 2000-05-05T21:23:48Z |
I tried at one time to write a UDF called simply perl(), which would allow
you to pass an arbitrary Perl expression as a string and some number of CHAR
arguments to a UDF that executes the expression in libperl.so.
It'd be a frightening security breach, but it would be pretty cool.
For instance, to guarantee capitalization of the initial letters of
someone's names:
SELECT perl('($s = "$1 $2. $3") =~ s/\b[a-z]/\U$&/g; $s',
FIRST_NAME, MIDDLE_INIT, LAST_NAME)
FROM MYTABLE;
Unfortunately, I ran into some stumbling blocks getting libperl.so to
execute in the context of a UDF (it worked in a standalone app) and then I
got busy on other stuff.
Bill Karwin
you to pass an arbitrary Perl expression as a string and some number of CHAR
arguments to a UDF that executes the expression in libperl.so.
It'd be a frightening security breach, but it would be pretty cool.
For instance, to guarantee capitalization of the initial letters of
someone's names:
SELECT perl('($s = "$1 $2. $3") =~ s/\b[a-z]/\U$&/g; $s',
FIRST_NAME, MIDDLE_INIT, LAST_NAME)
FROM MYTABLE;
Unfortunately, I ran into some stumbling blocks getting libperl.so to
execute in the context of a UDF (it worked in a standalone app) and then I
got busy on other stuff.
Bill Karwin
----- Original Message -----
From: "Tim Uckun" <tim@...>
> You know if there was a decent regular expression engine then we would not
> need 50 functions. The equavalent of the perl s// operator for example
> would be very powerful. Of course I still stand in awe of the perl
> substring function. The first time I typed in subtring (x, 5, -3) =
> substring (y, 2,10) I nearly wet my pants. Well you know what I mean.