The issue is that aborting the connection sometimes takes time. In your case $timeout * 3 seconds.
Enable debugging in order to see what's going on under the hood:
$Net::SFTP::Foreign::debug = -1;
In reply to Re: Net::SFTP::Foreign timeout value is inaccurate
by salva
in thread Net::SFTP::Foreign timeout value is inaccurate
by wanderedinn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |