mhearse has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I've a question which regarding perl/mysql. I'm trying to install a "User Defined Function" which allow s perl to be embedded in sql statements. See here. I've followed all the required instructions for compilation of the shared object. I then copied it to /usr/lib, and then ran ldconfig, which itself is configured to look in /usr/lib. Now I'm trying to i nsert the UDF record as follows:
CREATE FUNCTION myperl RETURNS STRING SONAME "my_perl.so";
And I recieve the error:
ERROR 1126: Can't open shared library 'my_perl.so' (errno: 22 my_perl. +so: cannot open shared object file: No such file or dire)
I guess I'm missing a step, and I'm not sure where to go. How does mysql know where to look for UDF obj ects? Will I have to recompile the mysqld? This is rather new territory, and I would realy appreciate any help. Has anyone else had experience with UDFs? Not necessarily this one.... Thanks much.

Replies are listed 'Best First'.
Re: MySQL UDF for Perl
by polettix (Vicar) on Sep 27, 2006 at 10:24 UTC
    I've no experience with UDF, but did you try to put the full path behind the name? Something like
    CREATE FUNCTION myperl RETURNS STRING SONAME "/usr/lib/my_perl.so";
    You'd probably peruse MySQL documentation about UDF, namely pre-requisites and installation details. Good luck!

    Flavio
    perl -ple'$_=reverse' <<<ti.xittelop@oivalf

    Don't fool yourself.