vrempire has asked for the wisdom of the Perl Monks concerning the following question:
#!/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"); } }
foreach $filefinish (@fileftp) { unlink $filefinish; }
Please help me on this problem,since I have tried to solve it in many other different ways,but still stuck in the same place.I really really apreciate it if anyone can tell me what's wrong with it and how to solve it.Thank you in advance. </body> </html>C:\Perl\bin>perl file.pl File x.wml has been transferred <br> File y.wml has been transferred <br> File z.wml has been transferred <br> x.wml: File not found y.wml: File not found z.wml: File not found C:\perl\bin>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Confuse and lost in Transfer files process
by tye (Sage) on Sep 18, 2000 at 08:26 UTC | |
|
Re: Confuse and lost in Transfer files process
by swiftone (Curate) on Sep 18, 2000 at 20:05 UTC | |
|
RE: Confuse and lost in Transfer files process
by moen (Hermit) on Sep 18, 2000 at 11:32 UTC | |
by tye (Sage) on Sep 18, 2000 at 19:17 UTC | |
|
Re: Confuse and lost in Transfer files process
by vrempire (Sexton) on Sep 22, 2000 at 04:25 UTC |