Re: FW: suggestion for sftp process



Curt Shaffer wrote:
This is what I have now:

my @files = $sftp->ls($remotedir);
foreach (@files){
$sftp->get("$_");
print "recieving $_...\n";
}
print "Complete!\n";

but what I get for each loop in debug is the following:

linuxbox: sftp: Sent message T:17 I:30
linuxbox sftp: Received stat reply T:101 I:30
Couldn't stat remote file: No such file or directory at ./sftptest line 24
recieving HASH(0x9dbb0ac)...

of course the HASH is different for each loop.

Any ideas?

Yes. My idea is that your reluctance to reading the documentation for
the module you're using is starting to get annoying.

type "perldoc Net::SFTP" at your command line, or visit
http://search.cpan.org/~dbrobins/Net-SFTP-0.10/lib/Net/SFTP.pm and
scroll down to where it talks about the ls() method. That will tell
you what that method returns. It describes the hash in detail.

Once you make an attempt at accessing the actual filename in that hash,
if it doesn't work, feel free to let us know.

Paul Lalli

.



Relevant Pages

  • Re: Noob! Help required and would be really appreciated!
    ... You've read 60% of "Learning Perl"? ... On finding the keyword "New Order", it has to start building a hash. ... want to build a loop around this hash creation. ... transferred to %allOrders. ...
    (comp.lang.perl.misc)
  • Re: multiline matching
    ... > City: Austin ... You never had more than one entry in the hash at a time. ... The for loop below is in the wrong spot. ... That loop fetches all the keys of the hash and then prints the Name, ...
    (perl.beginners)
  • Re: My hash table is in need of peer review
    ... struct hash { ... of the two possible loop exit conditions caused the loop to ... You might want to consider keeping the lists sorted ... same value pointer the caller hands you. ...
    (comp.lang.c)
  • Re: Loop over keys and values of a hashtable
    ... > that doesn't mean that accesses to a hash table are nondeterministic ... (loop for i being the hash-keys of foo using (hash-value j)) ... CL-USER> (time (loop for i being the hash-keys of foo ... ; Compiling LAMBDA NIL: ...
    (comp.lang.lisp)
  • Re: FW: suggestion for sftp process
    ... linuxbox sftp: Received stat reply T:101 I:30 ... of course the HASH is different for each loop. ... and which current working directory it is in. ...
    (perl.beginners)