i think what you want to do is: send one message and wait for the reply then again reply to reply received previously
you can use I/O multiplexing um.... that is to say you can use IO::Select module's can_read() and can_write() functions..... they check whether the socket is ready for reading or writing..... better than forking... check out the documentation of IO::Select