in reply to Sending multiple requests to a perl socket

Your read loop:
while($ans=<$sock>)
will not exit until the other side closes the socket.

Try doing a single read

$ans=<$sock>;
in a scalar context, then "print" to the socket, followed by another "read".

             My goal ... to kill off the slow brain cells that are holding me back from synergizing my knowledge of vertically integrated mobile platforms in local cloud-based content management system datafication.

Replies are listed 'Best First'.
Re^2: Sending multiple requests to a perl socket
by Anonymous Monk on Sep 23, 2013 at 15:48 UTC
    thanks NetWallah. I tried the following and still failed: my $ans1=<$sock>; my $ans2 = ""; $sock->flush(); if($ans1) { my $sent = $sock->send($PDU2); $ans2=<$sock>){ } print $ans2,"\n";
      "still failed" is an insufficient description - it does not help us in assisting you.

      Please add "print" statements at each step, with relevant data output. See WHERE it is failing, and with what error.

      You also need to print output for each alternative. In other words, if your "if" statement takes the "false" path, you need to add an "else" clause to print that the IF took that path.

      Please use <code> tags </code>, so your code displays in a more legible manner.

                   My goal ... to kill off the slow brain cells that are holding me back from synergizing my knowledge of vertically integrated mobile platforms in local cloud-based content management system datafication.