in reply to Test for newline

Look. If you want to test if a string is exactly equal to another string, use the "string equality operator" known as "eq", documented in perlop. $foo eq "\n"