Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: Catching die in Net::SFTP / Net::SSH::Perl:

by TedPride (Priest)
on Jul 15, 2010 at 07:33 UTC ( #849718=note: print w/replies, xml ) Need Help??

in reply to Catching die in Net::SFTP / Net::SSH::Perl:

Hmm, I don't know if I was a character off on my syntax somewhere, but eval seems to work now without errors.

On the other hand... I just broke Net::SFTP by trying to update some modules. So now I'm going to have to restore Perl from backup before I can test if this actually works or not. I was even using cpan to update, sometimes I really really hate Perl.


EDIT: Let's say I'm on a cloud server (Unix variant, Apache, etc.) and connecting to it via SFTP and SSH to update and run my code. If I'm understanding correctly, Net::SFTP::Foreign doesn't require all those millions of broken dependencies like Net::SFTP does, but it does require an SSH client of some sort. What client would that probably be and how would I interface with it? Can you give me a simple connection example? If I don't explictly specify something, will it use the standard ssh and/or sftp utilities?

  • Comment on Re: Catching die in Net::SFTP / Net::SSH::Perl:

Replies are listed 'Best First'.
Re^2: Catching die in Net::SFTP / Net::SSH::Perl:
by salva (Abbot) on Jul 15, 2010 at 08:48 UTC
    Net::SFTP::Foreign (...) does require an SSH client of some sort. What client would that probably be and how would I interface with it?

    If the box running your script has Linux or some other Unix installed, Net::SFTP::Foreign will just use the SSH client in your system (as long as it is named ssh and is in the PATH). You can also install OpenSSH in a custom location and tell the module to use it with the ssh_cmd option. As it seems that you are using password authentication you will also have to install Expect.

    If you want to run the script under Windows, your best option may probably be to use the Net::SSH2 backend Net::SFTP::Foreign::Backend::Net_SSH2. The default backend does not support password authentication under Windows because of Expect not working there. Alternatively, you could use plink (read the FAQ section from the module documentation for the details).

    Examples of how to connect to a remote server are included in the docs. Usually, this will do:

    my $sftp = Net::SFTP::Foreign->new($host, user => $user, passwd => $pa +sswd); $sftp->error and die "SFTP connection failed: " . $sftp->error;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://849718]
[Discipulus]: yes Eily, thanks oiskuu but i dont get it.. ;=( maybe I'll ask a SOPW
[LanX]: all combinations with same amount of left and right?
[Eily]: if you want to store in a structure with the coordinates as key, arrays might do, since the keys are going to be 0..n
[LanX]: (Pascale path)
[Eily]: paths like that
[Discipulus]: yes Eily++ (very keen) I want to integrate my project with a 17th experiments. I want to colorize in sequence all paths
[oiskuu]: Yeah, modifry the recursive func combinations() to return not the number, but the paths themselves.
[Eily]: Discipulus I'd do that by starting from the bottom node I think. That way it can inherit the paths from the two nodes above (and so on, recursively)
[LanX]: oh I meant fixed amount
[LanX]: every path must have l left and r right edges and l and r are fixed and l+r is the height

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2018-03-19 11:19 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (239 votes). Check out past polls.