Net::OpenSSH::ConnectionCache(3pm)

Net::OpenSSH::ConnectionCache3pm

Cache and reuse ssh connections transparently

Usage

  use Net::OpenSSH;
  use Net::OpenSSH::ConnectionCache;
  for (1..10) {
    my $ssh = Net::OpenSSH->new($host);
    $ssh->system("$cmd $_");
  }

Overview

This module installs a $Net::OpenSSH::FACTORY hook implementing a SSH connection caching scheme.

$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.

The function "clean_cache" makes the module forget (and close) all the cached connections:

  Net::OpenSSH::ConnectionCache::clean_cache();

Releases

7 releases since Debian 8 (Jessie); the text changed 6 times.

  1. 8
  2. 9
  3. 10
  4. 11
  5. 12
  6. 13
  7. Arch

From perl-net-openssh 0.84-5 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.