ssh->proxy( sub{ require Net::SOCKS; my $sock = new Net::SOCKS (...); ... return($sock); });