in reply to Test for newline
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Test for newline
by BUU (Prior) on Feb 19, 2005 at 09:23 UTC | |
by saintmike (Vicar) on Feb 19, 2005 at 19:24 UTC | |
|
Re^2: Test for newline
by holli (Abbot) on Feb 19, 2005 at 09:42 UTC |