------------------------------------------------
On Tue, 7 Oct 2003 15:43:00 -0400 , Roberts Mr Richard L <[EMAIL PROTECTED]> wrote:

> I am using NET::SSH::Perl. Login is correct. mkdir is correct. Yet when I
> try to pass a local file to remote host to copy file to newly created
> directory, it fails: 
> 
> code:
> use Net::SSH::Perl
> 
> my $ssh = Net::SSH::Perl->new($host);
> $ssh->login($user, $pass);
> 
> print $ssh->cmd("mkdir $site);
> print $ssh->cmd("cd $site); #does not change directory tested using
> "cmd("pwd")"
> print $ssh->cmd("cp $filename");
> 
> etc...
> 
> Any help would help.
> 

I assume this belongs in a new thread as it has very little to do with filehandles or 
anonymous hash references...Please start a new thread when appropriate.

Net::SSH::Perl is in a sense "stateless" depending on among other things the SSH 
protocol (aka 1 doesn't support multiple commands), etc.  My first question is, are 
you trying to copy a file from the local system to the remote?  Or are you trying to 
copy a remote file to a different remote location?  This latter is closer to what you 
are doing, but not as likely to be what you want to do?

If you are attempting the former then the 'cwd' doesn't really matter much and you are 
going to need something like Net::SFTP (which builds on Net::SSH::Perl) to do the 
copying. At which point you should just provide the directory in which to copy.

If you are attempting the latter since you know the name of the directory you are 
making why not just prepend it to the file name before doing the copy, rather than 
changing the working directory (which may or may not work).  And if this is the case 
you would have to know where you are copying the file from anyways and then adjust 
that path since it will no longer be your default location, so this is really all moot.

So, what are you trying to do, then we might be able to provide better assistance.

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to