Help for this page
system ('ssh -O exit localhost 2> /dev/null;'); use Expect; ... $su->soft_close(); # this step hang 15 seconds # $su->expect(undef); exit 0;
system ('ssh -O exit localhost 2> /dev/null; ssh -M localhost -fN 2> /dev/null'); ... $su->soft_close(); # this step now will not take more than 1 second #$su->expect(undef); exit 0;