in reply to How to chomp the last new line character from the file

In the spirit of TIMTOWTDI ...

$ perl -pe'eof&&chomp' file | nextprocess $ perl -0pe's/\n\Z//' file | nextprocess

Enjoy, Have FUN! H.Merijn