for (my $i = 0; $i < $num; $i++) { print "$ARGV[$i]\n"; open (FH, "$ARGV[$i]") || die "Cant open: $!"; while () { chomp; ## <- added this line push @out, lc; } close FH || die "Cant open: $!"; } #### print join (@out,"\n");