Net::OpenSSH::ConnectionCache - cache and reuse SSH connections transparently
use Net::OpenSSH; use Net::OpenSSH::ConnectionCache; for (1..10) { my $ssh = Net::OpenSSH->new($host); $ssh->system("$cmd $_"); }
This module installs a $Net::OpenSSH::FACTORY hook implementing a SSH connection caching scheme.
$Net::OpenSSH::FACTORY
$Net::OpenSSH::ConnectionCache::MAX_SIZE controls the cache size. Once as many connections are allocated, the module will try to free any of them before allocating a new one.
$Net::OpenSSH::ConnectionCache::MAX_SIZE
Copyright (C) 2011 by Salvador Fandiño (sfandino@yahoo.com)
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.
To install Net::OpenSSH, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::OpenSSH
CPAN shell
perl -MCPAN -e shell install Net::OpenSSH
For more information on module installation, please visit the detailed CPAN module installation guide.