Dominic Tan wrote:

> Hi, here is the script which I used to do the ftp with ASCII command. Please 
> advise. Thanks very much!!
> 
> #!perl
> 
> $ls_filename_e = "E26067.SRV" ;
> 
> use Net::FTP ;
> use constant HOST => 'hostname' ;
> 
> my $ftp = Net::FTP->new(HOST, Firewall=>'proxy') ;
> $ftp->login('userID', 'password') ;
> 
> $ftp->ascii() ;

That script doesn't do anything.  Do you have a proxy to go thru ?

Modify the 3 vrbls below and try first without the Firewall on the
new unless you're sure you need it (or comment mine out and put yours back).
(you can also set the firwall using

#       $ENV{FTP_FIREWALL} = '<my-firewall-machine>';

Is anything being downloaded using your script (obviously you must
have a get in yours for it to work).

use strict;
use Net::FTP;

my $file = "E26067.SRV";
my $user = 'user';      # modify me
my $pass = 'pass';      # modify me
my $host = 'hostname';  # modify me

$ENV{FTP_PASSIVE} = 1;  # set for passive connection

print "New FTP object to $host\n";
# my $ftp = Net::FTP->new($host, Firewall => 'proxy', Debug => 1) ;
my $ftp = Net::FTP->new($host, Debug => 1) or die "new Net::FTP: $!";

print "debug(1)\n";
$ftp->debug(1) or die "debug: $!";

print "login $user, $pass\n";
$ftp->login($user, $pass) or die "login: $!";

# added to get to my files for testing
# print "cwd 'public_html'\n";
# my $cwd = $ftp->cwd('public_html') or die "cwd 'public_html': $!\n";
# print "\t$cwd\n";

print "ascii\n";
$ftp->ascii() or die "ascii: $!";

print "get($file)\n";
if ($ftp->get($file)) {
        print "Got $file\n";
} else {
        print "Error getting $file: $!\n";
}
$ftp->quit;

__END__


-- 
  ,-/-  __      _  _         $Bill Luebkert    Mailto:[EMAIL PROTECTED]
 (_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]
  / ) /--<  o // //      Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to