Subject: | Net::SSH::Expect Suggestion |
Date: | Sat, 13 Oct 2007 14:43:58 -0700 |
To: | bug-Net-SSH-Expect [...] rt.cpan.org |
From: | Garrett Ellis <garrett.ellis [...] cox.net> |
Mr. Negrao:
Thank you for taking the time to write Net::SSH::Expect. This package
does not solve all of my problems, but it gives me a great reference for
doing so. Your implementation relies on "ssh" being in the current
user's PATH, and I agree that in most cases it should be in the PATH.
However, I believe Net::SSH::Expect would be more flexible if the user
code was allowed to specify the absolute path to the SSH binary.
To effect this change, I suggest the following:
use fields qw(
host user password port no_terminal escape_char ssh_option
raw_pty exp_internal exp_debug log_file log_stdout
restart_timeout_upon_receive
timeout terminator expect debug next_line before match after binary
);
sub new {
. . .
$self->{binary} = $args{binary} || "ssh"; # Allow user to specify
path to SSH binary.
. . .
}
sub run_ssh {
. . .
my $ssh_string=$self->{binary};
$ssh_string .= " $flags $user\@$host";
. . .
}
If you decide to use my idea, please feel free to mention me in the
documentation. :)
Cheers,
Garrett Ellis