in reply to Re^2: substring search in an array of arrays
in thread substring search in an array of arrays

Don't pretend... Don't pretend...

I'm not pretending anything. And don't tell me what to do...explain why...with examples.


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."
  • Comment on Re^3: substring search in an array of arrays

Replies are listed 'Best First'.
Re^4: substring search in an array of arrays
by ikegami (Patriarch) on Feb 14, 2008 at 22:53 UTC

    Sure thing. An example where the confusion leads to a difference would be $_[0] =~ "Dr.". It doesn't search for "Dr.", it searches for a three char string starting with "Dr". I mentioned split because split '|', ... is a similar common error and a reference to past threads on the topic.

      In other words, whatever is on the RHS of =~ acts exactly like a regex...regardless of whether it is in // delimiters or "" delimiters. Or even if it is contained within a variable. That's exactly what I thought.


      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.
        I didn't doubt that you knew. Considering how many people get messed up over split's first argument, I figured the extra clarification of using // over "" is warranted, if not for your own benefit, for that of the person receiving your help and that of the person reading and maintaining your code.