in reply to Re: Net::Ftp->login problem
in thread Net::Ftp->login problem
#!/usr/bin/perl -w use Net::FTP; use strict; my $site = shift @ARGV; my $dir = shift @ARGV; my $sd = "/SCRIPTS"; my $wd = "/DATA"; my $access_file="$sd/ftp_access_info/$site.pwd"; my $ftp; # name for the ftp class my $host; # ftp name my $user; # user name for ftp my $pass; # password for ftp my @files; # list of files on the ftp #get access info from file open(FTP_ACCESS, "<" , $access_file); my @ftp_access = <FTP_ACCESS>; chomp @ftp_access; close (FTP_ACCESS); #set access info $host = $ftp_access[0]; $user = $ftp_access[1]; $pass = $ftp_access[2]; print "|$host|\n|$user|\n|$pass|\n"; #get directory listing print "Connecting\n"; $ftp=Net::FTP->new("$host",Timeout=>240) or die "connect\n"; print "Loging in\n"; $ftp->login("$user","$pass") or die "login\n"; print "Getting File lists\n"; $ftp->cwd($dir) if $dir; @files=$ftp->dir or die "dir\n"; print "$_\n" foreach @files; $ftp->quit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Net::Ftp->login problem
by marto (Cardinal) on Oct 31, 2007 at 10:35 UTC | |
by KianTern (Acolyte) on Oct 31, 2007 at 10:45 UTC | |
by marto (Cardinal) on Oct 31, 2007 at 10:53 UTC | |
|
Re^3: Net::Ftp->login problem
by Rabbi Bob (Scribe) on Nov 01, 2007 at 10:43 UTC | |
|
Re^3: Net::Ftp->login problem
by Anonymous Monk on Oct 31, 2007 at 10:20 UTC |