After asking for help at the perlmonks forum, the author of the Net: OpenSSH module replied.
Http://www.perlmonks.org /? Node_id = 923770
----------------------------------------------------------------------
It seems that once the maxsessions limit is reached, the SSH client tries to establish a new connection.
As a workaround, the following hack seems to work, just making the command fail:
My $ SSH = net: OpenSSH-> New ($ host );
Push @ {$ ssh-> {_ ssh_opts}, '-oconnectionattempts = 0 ';
...
[Download]
AfterCaptureMethod call, in case of too reset session,$ Ssh-> ErrorWill beOssh_slave_pai_failedAnd$? = 255.
I will add some option to the constructor to allow for setting slave SSH arguments without fiddling with the object interiors.
Anyway, instead of Forking and unlimited number of processes, you cocould also use parallel: forkmanager or proc: queue to get it under control.