in reply to Re: Bidirectional Communication using sockets and forking
in thread Bidirectional Communication using sockets and forking

That was the first initial thing I tried, at the Server.pl program, it would allow writing at that terminal session but whatever typed in is not conveyed through into the client session, the same thing is true vice versa...
  • Comment on Re^2: Bidirectional Communication using sockets and forking

Replies are listed 'Best First'.
Re^3: Bidirectional Communication using sockets and forking
by almut (Canon) on Dec 28, 2009 at 13:06 UTC
    That was the first initial thing I tried, at the Server.pl program

    Did you have it in Client.pl, too?  With if (defined($child_pid)), the client would never execute its read loop either, i.e.

    while(my $line = <$socket>){ print "SERVER says: $line\n"; }

    With the mentioned change in both Server.pl and Client.pl, your code works fine for me... — except that you may not want to add another empty line every time the server sends a line to the client  (the superfluous "\n" in print $client "$line\n"; ).