use strict; use warnings; my @servers; open (my $file, '<', $ARGV[0]) or die $!; while(<$file>){ push (@servers, $_); #push each line of the file to array } print "$_\n" for(@servers);