in reply to ftplist.pl
and then you can skipopen(FilesToGet, "FilesToGet.txt") or die "can't open FilesToGet.txt: $!"; while (<FilesToGet>) {
and just do:$TheFile = $_; chomp($TheFile); $INFILE = $TheFile;
but to make life even easier:chomp; $ftp->get($_);
#!/usr/bin/perl -w use Net::FTP; use strict; my $hostname = 'user defined'; my $username = 'user defined'; my $password = 'user defined'; my $home = 'user defined'; my $debug = 5; open(FilesToGet, "FilesToGet.txt") or die "can't open FilesToGet.txt: $!"; my $ftp = Net::FTP->new($hostname); $ftp->login($username, $password); $ftp->cwd($home); while (<FilesToGet>) { print STDERR "Getting $_" if $debug > 3; chomp; $ftp->get($_); } $ftp->quit;
a
|
|---|