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-