in reply to Perl Sockets Problem
should do the trick. The receiver is already set up to keep listening until the socket gives it an EOF.while (my $msg = <STDIN>) { print $sock "$msg\n"; } close $sock;
For b), I suppose a command-line switch to tell it whether to start in client (sender) or server (receiver) mode, then use the appropriate set of args to IO::Socket->new and corresponding while loop based on that.
|
|---|