sub run_ssh { my Net::SSH::Expect $self = shift; #(clipped setting up of user options and flags) my $exp = new Expect(); #(clipped setting of Expect options based on user opts/flags) my $success = $exp->spawn($ssh_string); return (defined $success); }