I do have permission those ftp accounts where created for my usage.
Firewall not blocking i can access the sites with standard ftp client
all the access info was copy/pasted from the origial documents. I also tried to copy paste the user and pass from
my .pwd file and it works great
and I still can connect to one remote and one local ftps using this code
#!/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;
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|