in reply to IO::Socket server->client

Sockets are bidirectional, so just print out the output back to the socket. Of course, system doesn't actually return the output, so you'll need something else.

my $client_sock = $sock->accept(); while(<$client_sock>){ chomp; print $client_sock `$_`; }

You'll need to add some kind of system to allow the client to know when the server is done sending.

Are you just exploring, or are you reinventing ssh?

Replies are listed 'Best First'.
Re^2: IO::Socket server->client
by Illuminatus (Curate) on Oct 12, 2008 at 18:38 UTC
    What you are describing is exactly what inetd/xinetd is designed for http://linux.die.net/man/8/xinetd. Of course, if you are just trying socket code out, there are numerous tutorials/examples here at the monastery.