#!/usr/bin/perl use DBI; use Net::FTP; use File::Basename; use warnings; use strict; #connection paraneters to localhost my $IP='192.168.1.2'; my $users='stevieb'; my $password='blah'; my $directory="/"; #Connection to netboss my $ftp = Net::FTP->new($IP, Debug => 0, Passive => 0) or die "cannot connect"; $ftp->login($users,$password); $ftp->cwd($directory); #list files my @fichier = $ftp->ls($directory); for my $entry (@fichier) { my $filename = basename( $entry ); if( $filename =~ "blah.txt" ){ # you'll need to uncomment the next line, and comment out # the one below it to return to your desired behaviour #$ftp->get($filename,"C:/users/Desk/personal".$filename); $ftp->get( $filename ); } } $ftp->quit;