mallen has asked for the wisdom of the Perl Monks concerning the following question:
#! c:\perl\bin\perl.exe -w use Net::FTP; # Login info my $host='ernie'; my $user='bert'; my $password='orange'; #print $user; # Change Dir After Login to this dir: my $remote_directory='d:/inetpub/ftproot/carquest'; my $remote_file='pull.txt'; my $home_directory='c:/ftp'; my $file='ftpout.txt'; my $fname="$home_directory/$file"; #print "$fname\n"; $ftp=Net::FTP->new ($host,Timeout=>240); $ftp->login($user, $password) or die "Couldn't login\n"; print "Your are logged in to $host.\n"; $ftp->ascii; #$ftp->get ($remote_file, $home_directory) or die # "Can't get remotefiles: $!\n"; $ftp->put ($fname, $remote_directory) or die "OOPS! Can't send localfiles: $!\n"; print "All files have been transmitted to $host.\n"; $ftp->quit; print "Everything is done.\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Ftp Script
by nimdokk (Vicar) on Jun 24, 2004 at 18:10 UTC |