in reply to Re^2: Trouble with sockets
in thread Trouble with sockets

This code will give you a functional server you can telnet into. Don't use it for anything but testing:

#!/usr/bin/perl -w use strict; use IO::Socket; my $sock = IO::Socket::INET->new( Listen => 1, LocalAddr => 'localhost', LocalPort => 9000, ) || die "Unable to create socket: $!\n"; print "Waiting for message...\n"; while ( my $fh = $sock->accept()) { print while <$fh>; } close ($sock);

cheers

tachyon