foreach $line () { chomp($line); push(@array, $line); #### chomp( @array = ); #### use strict; use warnings; #### open my $msgFH, q{<}, q{/some/file} or die qq{open: < /some/file: $!\n};