in reply to capture multiple lines
my @txtfile; while (<$fh>) { chomp; push @txtfile, $_; } [download]
Alternately, after you have read the file into your array, chomp the whole array:
chomp @txtfile; [download]