[ic] include GlobalSub in interchange.cfg

Ed LaFrance interchange-users@interchange.redhat.com
Mon Apr 1 12:45:01 2002


At 12:24 PM 04/01/2002 -0500, you wrote:
>I tried that. When I use IO::Socket::INET it works fine in a stand alone
>perl program but breaks when run as a GlobalSub. Somehow ic is being
>blocked from loading the module.
>
>I don't know how to ask Perl if a module is installed but since it
>compiles and runs OK I have some strong evidence that it is there.

I don't know how you have structured your code, since you never posted it, 
but try your 'use' statement outside of the sub {} body if it is not 
already that way, i.e.:

GlobalSub <<EOS
use IO::Socket::INET;
sub {
         ...
}
EOS



- Ed L.






>On Mon, 2002-04-01 at 12:01, Kevin Walsh wrote:
> > >
> > > My GlobalSub opens a socket to talk to another server. I have tested
> > > this as a perl program from my command line where it works fine. Here is
> > > part of the code:
> > >
> > > use IO::Socket;
> > > my $server = '206.191.4.228';
> > > my $port = 30000;
> > >
> > > my $sock = IO::Socket::INET->new(
> > >   Proto  => "tcp",
> > >   PeerAddr => $server,
> > >   PeerPort => $port,
> > >   Reuse => 1
> > >   );
> > >  unless ($sock) { return("cannot connect to remote host"); }
> > >
> > > But when I try to run this through ic I get this error message:
> > >
> > > 127.0.0.1 uthu8k6e:127.0.0.1 - [31/March/2002:23:48:00 -0500] foundation
> > > /cgi-bin/foundation/aboutus.html Safe: Can't locate object method "new"
> > > via package "IO::Socket::INET" (perhaps you forgot to load
> > > "IO::Socket::INET"?) at (eval 128) line 34.
> > >
> > You might want to try installing the IO::Socket::INET module.
> > If its already installed "use IO::Socket::INET;" may help.
> >
> > --
> >    _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
> >   _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
> >  _/ _/    _/          _/ _/     _/    _/  _/_/    kevin@cursor.biz
> > _/   _/  _/_/_/_/      _/    _/_/_/  _/    _/
> >
> > _______________________________________________
> > interchange-users mailing list
> > interchange-users@interchange.redhat.com
> > http://interchange.redhat.com/mailman/listinfo/interchange-users
>
>
>_______________________________________________
>interchange-users mailing list
>interchange-users@interchange.redhat.com
>http://interchange.redhat.com/mailman/listinfo/interchange-users

===============================================================
New Media E.M.S.               Software Solutions for Business
463 Main St., Suite D          eCommerce | Consulting | Hosting
Placerville, CA  95667         edl@newmediaems.com
(530) 622-9421                 http://www.newmediaems.com
(866) 519-4680 Toll-Free       (530) 622-9426 Fax
===============================================================