pseudo code #!/usr/local/bin/perl @args = ("ssh", "unaccesible_client", "&"); #bring process in background as we want to continue... #do some stuff $time=start_time(); #after some time get status while ($time > 1000us) { $status=get_status(); if ($status!=running) { $time=1000; } } ... ...