foreach $key(%Servers){ #### my @Servers = qw( 128.37.37.201 128.38.38.201 128.39.39.201 ); foreach my $IP ( @Servers ) { my $FTP = Net::FTP->new($IP); if ( $FTP->login($user,$pass) ) { $FTP->ascii(); $FTP->put($File); $FTP->quit; } else { print "Error logging in to $IP: ". $FTP->message ."\n"; } }