[ic] Calling a PERL function using a custom defined Globalsub

Rick Eicher II interchange-users@interchange.redhat.com
Wed Jan 2 12:40:00 2002


>
>
> Platform: IC 4.8.3, PERL 5.6, RH Linux 7.2., PGSQL
> __
>
> We are trying to do a custom subroutine that performs an HTTP post to
> another server.
>
> In our Globalsub we created a new routine called posttoserver which is the
> starting point for our work, however, we cannot get this simple
> function to
> work within Interchange:
>
> Here is an example:
>
> ********
> LINE#		ACTUAL TEXT
>
> 1		GlobalSub <<EOF
> 2		sub posttoserver {
> 3
> 4		use strict;
> 5		use sigtrap;
> 6		use IO::Socket::INET;
> 7
> 8		my $result =  IO::Socket::INET->new("www.fredpope.com:80");
> 9			print $result "GET \r\n";
> 10		my @out=<$result>;
> 11
> 12		close ($result);
> 13
> 14		print("Content-Type: text/html\n\n");
> 15		print ("@out");
> 16			}
> 17		EOF
>
> ********
>
> If I remove a line at the top and at the bottom, this runs predictably, as
> filename.pl in the cgi-bin directory but when I call it from interchange,
> nothing happens. Here is how I am calling it:
>
> [perl subs=yes]posttoserver[/perl]

Is the global sub actual trying to run? Change the global sub to some thing
like hello world. If the global sub is not running at all is it including in
the conf file.

Once you get a simple global sub working then you can get complex with it.

If it is running but is not working right, then forget this reply. :)

>
> It seems that we cannot make a call to the line 6 without it hanging up.
>
> Thanks in advance for any help.
> --
> Fred Pope
> Satcom Resources
> 970-748-3094
> fred@satcomresources.com
> http://www.satcomresources.com
>