bulent_sahin has asked for the wisdom of the Perl Monks concerning the following question:

my Dear Perl Friends,
I am trying to write a central backup sw with Perl.
and I would like to use your Net::SFTP::Foreign module in my perl code.
 
I have also use PuTTY for SSH connection to my systems.
 
I wrote my Perl code with Net::SFTP:Foreign, but I got following error line,
 
'ssh' is not recognized as an internal or external command, operable program or batch file.
I think, I have to associate PuTTy or any ssh client with Net::SFTP::Foreign But I don't know... How can I do ?? Could you please help me to make this association ? it is very critical for me... Where I can find a resource about this issue ? Thank you very much for your valuable help... with my Best Regards, bulent_sahin.

Replies are listed 'Best First'.
Re: how can i use PuTTY under Net::SFTP::Foreign ?
by moklevat (Priest) on Mar 05, 2008 at 15:24 UTC
    From Net:SFTP::Foreign it looks like you define your external SSH client by ssh_cmd => $sshcmd.

    From the PuTTY Documentation it looks like you invoke putty from the command line by putty.exe [-ssh | -telnet | -rlogin | -raw] [user@]host.

    However, depending on what you are trying to do, you may want to use PuTTY's PSFTP or PSCP clients instead.

Re: how can i use PuTTY under Net::SFTP::Foreign ?
by pc88mxer (Vicar) on Mar 05, 2008 at 15:24 UTC
    I think this is as easy as using the the ssh_cmd parameter:
    my $sftp = new Net::SFTP::Foreign(ssh_cmd => 'C:/path/to/putty.exe', h +ost => ...); ...
Re: how can i use PuTTY under Net::SFTP::Foreign ?
by salva (Canon) on Jul 17, 2008 at 13:22 UTC
    from version 1.38, Net::SFTP::Foreign has native support for plink.

    Just ensure that it is on the %PATH and...

    my $sftp = Net::SFTP::Foreign->new($host, $ssh_cmd => 'plink');