If you want to check if the value of a variable equals the newline character, just use $variable eq "\n" as a test, there's no need to use a regex.
And, of course, $foo =~ "pattern" isn't a regular expression match. I'm not quite sure why it isn't a syntax error, but it's certainly wrong. $foo =~ /pattern/ is probably what you mean.
In reply to Re: Test for newline
by saintmike
in thread Test for newline
by tlemons
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |