in reply to Re: Test for newline
in thread Test for newline

While your first two points are correct, I'm afraid I must point out that your third point is incorrect.

$foo =~ "pattern" is mostly certainly a regular expression match, with the expression "pattern" being applied to the variable $foo. The =~ operator will accept anything that may be stringified as it's right hand side, which is really what a regex is, // are just fancy quotes that have slightly different semantics.

Replies are listed 'Best First'.
Re^3: Test for newline
by saintmike (Vicar) on Feb 19, 2005 at 19:24 UTC
    Interesting, thanks for pointing that out!

    I wouldn't recommend using $string =~ "...", though, it's confusing to beginners. Imagine if someone writes "\w" and wonders why it behaves differently than /\w/.