LWP::Simple in Postgresql 7.3.4

From: "Siew Hui, Wong" <shwong(at)sebasasia(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: LWP::Simple in Postgresql 7.3.4
Date: 2004-03-17 06:02:48
Message-ID: 007d01c40be5$7a28ff60$320a0a0a@siewhui
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Postgres 7.3.4
Perl 5.6.0 and Perl 5.8.1
RH 7

I have to implement some new postgres functions that need LWP::Simple , but
i've received errors in locating that module. By the way, the server
contains 2 perl versions for the previous administrator had problems
implementing scripts with LWP::Simple and has installed a second,
higher-version of Perl i.e. 5.8.1.

Upon running, the following trigger and functions in the db produced this
error:

ERROR: plperl: error from function : Can't locate LWP/Simple.pm in @INC
(@INC contains: /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0
/usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0
/usr/lib/perl5/site_perl .) at (eval 3) line 8. BEGIN failed--compilation
aborted at (eval 3) line 8. The specific sequence of files included or
processed is : /hello/world.cfm

CREATE TRIGGER autokuda
AFTER INSERT ON temp_spp_kuda_live
FOR EACH ROW
EXECUTE PROCEDURE sendkuda ();

CREATE FUNCTION sendkuda () RETURNS "trigger"
AS '
begin
perform KudaRedirect (NEW.tkl_gateway, NEW.tkl_keyword , NEW.tkl_mobile);
return NEW;
end;
'
LANGUAGE plpgsql;

CREATE FUNCTION kudaredirect (character varying, character varying,
character varying) RETURNS integer
AS '
$gateway = $_[1];
$keyword = $_[2];
$mobileno = $_[3];
my $url =
"http://www.helloworld.com/xxx.asp?gateway=$gateway&text=$keyword&from=$mobi
leno";
use LWP::Simple;
my $content = get $url;
if (! defined $content) {
system("/bin/echo KUDA: FAIL REDIRECT TO $gateway $keyword $mobileno >>
/path/to/fail.log");
}

system("/bin/echo KUDA: REDIRECT $gateway $keyword $mobileno >>
/path/to/success.log");
return 0;
'
LANGUAGE plperlu;

When i tried to install LWP::Simple, it just installed in 5.8.1 by default.
How can i point postgresql to use LWP::Simple in perl 5.8.1? Or at least
install LWP::Simple in perl 5.6...Other solutions are very much welcomed.

Also,I didn't uninstall perl 5.8 for i don't know what else depends on it.

Thank you for the time taken to ponder this :)

best regards
siew hui

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John Sidney-Woollett 2004-03-17 06:42:26 Re: Lock inside trigger
Previous Message Stephen Robert Norris 2004-03-16 22:50:35 Re: fsync