#!/usr/bin/perl -w use Net::FTP; $LIC_DIR = "/home/user/admin/keys"; @files = grep(/\.lic$/, readdir(LDIR)); $ftp = Net::FTP->new("ip address") or die "can't connect: $@\n"; $ftp->login("user", "password") or die "couldn't login\n"; $ftp->cwd("/etc/vx/elm") or die "couldn't change directory\n"; $ftp->binary(); $ftp->quot("prompt"); foreach $x ( @files ) { $x =~ s/.lic/; print "Getting file $x\n"; $ftp->get($x) or die "couldn't get $x: $@\n"; } $ftp->quit; # outta here