Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Answer: How can I FTP files from within PERL WITHOUT NET::FTP?

by Anonymous Monk
on Nov 14, 2000 at 13:00 UTC ( #41537=categorized answer: print w/replies, xml ) Need Help??

Q&A > HTTP and FTP clients > How can I FTP files from within PERL WITHOUT NET::FTP? - Answer contributed by Anonymous Monk

Hi,how about you try to play around with this code.It includes an FTP process.I'm trying to use UNIX embedded command inside the program, instead of using the NET::FTP.
#!/usr/bin/perl print "Content-type:text/html\n\n"; use File::Copy; $remotehost1 ="a"; $remotepath ="/b"; $remoteuser ="c"; $remotepass ="d"; @fileftp = qw(x.wml y.wml z.wml); $cmd="ftp -n"; foreach $wmlfile (@fileftp) { if(-f $wmlfile) { $ftp_commands = " open $remotehost1 user $remoteuser $remotepass cd $remotepath asc put $wmlfile bye "; open (CMD, "|$cmd"); print CMD $ftp_commands; close (CMD); print "File $wmlfile has been transferred \n"; print "<br>\n"; $finish = 'transfer'; copy ("$wmlfile","./$finish/$wmlfile"); } }

Hope,it will help. -VREMPIRE-

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2017-11-24 19:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (353 votes). Check out past polls.

    Notices?