Re: LWP::Simple in Postgresql 7.3.4 - SOLUTION - Mailing list pgsql-general

From Siew Hui, Wong
Subject Re: LWP::Simple in Postgresql 7.3.4 - SOLUTION
Date
Msg-id 005301c40c8a$990ad2a0$320a0a0a@siewhui
Whole thread Raw
In response to Data Corruption in case of abrupt failure  (satish satish <satish_ach2003@yahoo.com>)
List pgsql-general
Dear list,

THe location of  Simple.pm in my server is
/usr/local/lib/perl5/site_perl/5.8.1/LWP/. The problem is solved by adding a
code that points to LWP/Simple.pm before the "use LWP::Simple".

<snip!>

use lib "/usr/local/lib/perl5/site_perl/5.8.1/;
use LWP::Simple;

<snip!>

It worked like a charm, but other problems cropped up. But that's more like
a perl error that i shouldn't bother you guys :)

thanks

best regards,
siew hui



----- Original Message -----
From: "Siew Hui, Wong" <shwong@sebasasia.com>
To: <pgsql-general@postgresql.org>
Sent: Wednesday, March 17, 2004 2:02 PM
Subject: [GENERAL] LWP::Simple in Postgresql 7.3.4


> 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
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>


pgsql-general by date:

Previous
From: Gregory Wood
Date:
Subject: Re: Triggers After INSERT
Next
From: Denis Gasparin
Date:
Subject: Re: Smallint - Integer Casting Problems in Plpgsql functions