#!/usr/local/bin/perl -w use Net::FTP; #use strict; $host = 'www.ftp.com'; $user = 'anonymous'; $pass = 'updatepuller@somewhere.com'; $remote_dir = '/path/to/remote/directory'; $oldfilename = `ls current-sig`; chomp $oldfilename; $destination_dir= "current-sig"; $ftp = Net::FTP->new($host, Debug => 1); $ftp->login($user,$pass); my @listing = $ftp->ls("$remote_dir"); for (@listing) { if ( /x86.exe/i ) { open(FH, ">> myfile.txt") || die "Can't open $file for write: $!"; print FH "$_\n" } } close FH; open FH, "myfile.txt" or die "Couldn't open: $!"; while () { @test = print "$_" } close FH; #$ftp->get("$remote_dir/$filename","$destination_dir/$filename"); $ftp->pasv(); $ftp->quit;