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.
In reply to Re: Perl Sockets Problem
by dsheroh
in thread Perl Sockets Problem
by shadowoflinux
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |