in reply to How to replace 'goto' by another construct?

Since you are in a loop, you could replace the goto calls with subroutine calls and next, e.g:
for(;;) { if ($array[$incr] eq "[SEND]") { if( .. whatever .. ) { $incr++; outer(); next; } } elsif ($array[$incr] eq "[RECV]") { ... $incr++ inner(); next; } } sub outer { my $msg=$method; print "\nSending message:$msg"; $MySocket->send($msg); } sub inner { print "Waiting for Response:\n"; $MySocket->recv ($text,1000);#///Recv print "\nReceived message From:$text"; }

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}