in reply to Perl script to read 500 entries from a .txt file

A while loop would be the solution instead that for loop.
while(<ENABLE>){ my $server = $_; # $_ is the var that contians the whole line # but $_ is ambiguous so we'll give it the $server chomp $server; #remove newline #other stuff }

Replies are listed 'Best First'.
Re^2: Perl script to read 500 entries from a .txt file
by perlaintdead (Scribe) on Jun 17, 2014 at 02:03 UTC

    Also the hostanmes.txt is misspelled