in reply to Re^2: using split
in thread using split

There is one subtle difference between using '...' and /.../ as regex delimiters. The latter interpolates where the former does not. That does not affect the examples in this thread though.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^4: using split
by ikegami (Patriarch) on Jun 05, 2007 at 13:19 UTC

    And the difference between "..." and /.../ is that "..." unescapes too much.

    For example,
    "\d" is the same as /d/.
    If you want /\d/, the equivalent would be "\\d".

    I always use /.../ or qr/.../ to avoid confusion.

      Yes. I never use "...", preferring m[...] instead. Using '...' for a regex is simply shorthand for m'...' which gives the same, non-interpolating behaviour.

      A bad habit? Maybe...


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.