Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: net::Ftp::rercursive->rput

by Asim (Hermit)
on Jun 23, 2006 at 14:00 UTC ( [id://557188]=note: print w/replies, xml ) Need Help??


in reply to net::Ftp::rercursive->rput

Hi!

UPDATE: I recommend you go with the examples noted above, rather than on the code below, which is untested. In paticular, I'm unable to test the assertion that rput works on *NIX in the manner I mention below.

If you look at the docs for Net::FTP::Recursive, they do a pretty good job of explaining things from a Perl perspective. Here's an example of how the code might go, based on the docs for the module in question:

# WARNING: Untested code! use strict; use warnings; use Net::FTP::Recursive; my $ftp = Net::FTP::Recursive->new("some.host.name", Debug => 0); $ftp->login("anonymous",'me@here.there'); #Change the directory in the below command # to the root of the directories you wish # to upload to $ftp->cwd('/pub'); # You must have your script in the proper # local directory; this module automatically # uploads it's working directory chdir('/home/user/data_to_upload'); # According to docs, rput should "just work" # on Unix-like systems $ftp->rput(); $ftp->quit();

Unless I'm missing something? I hope that works for you; I don't have an FTP site here I can test with.

----Asim, known to some as Woodrow.

Replies are listed 'Best First'.
Re^2: net::Ftp::rercursive->rput
by Anonymous Monk on Jun 24, 2006 at 06:54 UTC
    hi it shows an error while executing the line $ftp->rput(); the error is 'ls-la' is not recognized as an internal or external command' '/' is current directory please resolve this

      Please don't take this wrong. Perhaps you've moved on and done what I'll say below, but I don't know, and I have to assume you have not.

      You'll note that I added a note to my original encouraging the use of the code marto posted first, over mine. In addition, I encouraged you to read the actual documentation for the class, which would have shown you where the ls -la bit comes from. And, I pointed out in the comment, and the code, that this is for Unix-like systems, which, based upon the error message you reported, you are not trying to FTP to.

      We are happy to help, and code snippets have been provided. Have you tried the code samples marto pointed you to? If my code does not work, the code from the modules' development team is much more likely to. And if it does not, please give us more data, as mentioned in How do I post a question effectively? and Perlmonks FAQ.

      Why? Because we've here to help, and it's best if you help us help you. Those documents will tell you how, and how to give info like the Operating Systems, which might just be your main issue. But I don't know that, and thus cannot help you resolve the issue.

      Bottom line: I CANNOT debug your error properly without you testing the other code sample, and providing more complete details about you goals. OK?

      ----Asim, known to some as Woodrow.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://557188]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2025-01-21 22:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (62 votes). Check out past polls.