in reply to Socket error

Not knowing what kind of system you're using, I'd suggest there's a mismatch between the tcp protocol you're trying to use and the type of socket you want to open; tcp uses SOCK_STREAM (third argument to the socket call) and I bet the number you have there doesn't correspond to that type. I'd play it safe and do the call the portable way, using the constants the Socket module defines:

use strict; use Socket; my $proto = getprotobyname('tcp'); socket(SOCKET, PF_INET, SOCK_STREAM, $proto) or die "Can't open socket: $!\n";

HTH

perl -e 'print "How sweet does a rose smell? "; chomp $n = <STDIN>; $r +ose = "smells sweet to degree $n"; *other_name = *rose; print "$other +_name\n"'

Replies are listed 'Best First'.
Re: Re: Socket error
by sajid (Initiate) on May 09, 2001 at 17:55 UTC
    Thank you very much that worked ! I appreciate your help. Thanks a lot