http://www.perlmonks.org?node_id=1059915


in reply to how to deal with newline

-n reads the file line by line. Have you looked at what $_ contains for each of your checks?