perl -pe "chomp;" text.txt #### LINE: while (defined($_ = )) { chomp $_; } continue { die "-p destination: $!\n" unless print $_; } #### perl -ne "chomp;print" text.txt #### LINE: while (defined($_ = )) { chomp $_; print $_; }