wolfger has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; use Socket; use Net::FTP; $site = 'ftp.wolfger.com'; $address = inet_ntoa(inet_aton($site))); $ftp = Net::FTP->new ( "ftp.wolfger.com", Timeout => 60 ) or die "Connection failed to $address\n"; $user = "<insert username here>"; $pass = "<insert password here>"; $ftp->login($user, $pass) or die "Login failed for $user.\n"; $ftp->cwd('./main_html'); $ftp->type('binary'); $local = "/home/wolfger/Shared/Documents/wolfger/howllog.html"; $remote = "howllog.html"; $ftp->put($local, $remote) or die "Failed to put file $remote.\n"; $ftp->quit() or die "Could not quit connection to $address\n";
Edit: Added <code> tags. larsen
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Net::FTP only working occasionally.
by Mr. Muskrat (Canon) on Mar 31, 2003 at 16:07 UTC | |
by wolfger (Deacon) on Mar 31, 2003 at 18:29 UTC | |
by michaeld (Monk) on Apr 01, 2003 at 18:53 UTC | |
Re: Net::FTP only working occasionally.
by runrig (Abbot) on Mar 31, 2003 at 18:41 UTC | |
Re: Net::FTP only working occasionally.
by Mr. Muskrat (Canon) on Mar 31, 2003 at 18:45 UTC | |
by wolfger (Deacon) on Mar 31, 2003 at 23:50 UTC |