I am trying to write a simple little client server relationship.

I receive the error:
Uncaught exception from user code:
        Uncaught exception from user code:
        Can't locate IO/Socket/INET.pm in @INC (@INC contains:
/usr/opt/perl5/li
b/5.00503/aix /usr/opt/perl5/lib/5.00503
/usr/opt/perl5/lib/site_perl/5.005/aix
/usr/opt/perl5/lib/site_perl/5.005 .) at ./client.pl line 9.
        main::BEGIN() called at IO/Socket/INET.pm line 9
        eval {...} called at IO/Socket/INET.pm line 9
BEGIN failed--compilation aborted at ./client.pl line 9.

My code reads like this:
     #!/usr/bin/perl -w
     use diagnostics;
     use strict;
     select STDOUT;
     $| = 1;
     select STDERR;
     $| = 1;

     use IO::Socket::INET;

     my ($remote_host) = "<somehost>";
     my ($remote_port) = "7";

     my $socket = IO::Socket::INET->new(     PeerAddr => $remote_host,
                                             PeerPort => $remote_port,
                                             Proto    => "tcp",
                                             Type     => SOCK_STREAM )
             or die "$0: Couldn't connect to $remote_host:$remote_port: $!
\n";

     print $socket "This is client. Hello\n";

     close ($socket);

The IO/Socket directory exists in one of the paths in my @INC.  Within
Socket.pm there is the line:

     [snip]
     package IO::Socket::INET;

     use strict;
     use vars qw(@ISA);
     use Socket;
     use Carp;
     use Exporter;

     @ISA = qw(IO::Socket);

     IO::Socket::INET->register_domain( AF_INET );

     my %socket_type = ( tcp => SOCK_STREAM,
                         udp => SOCK_DGRAM,
                         icmp => SOCK_RAW,
                       );
     [snip]

So I fail to see the problem.  It seems to work if I change the use line
to: "use IO::Socket;" but that is 'incorrect' or at the very least
imprecise right ?


Thanks,

-----------------------------------------
Craig Moynes
[EMAIL PROTECTED]


Reply via email to