in reply to Re^3: Why do I need parentheses here?
in thread Why do I need parentheses here?

Is there any difference between /PAT/ and qr/PAT/ ??? I thought this is *always* the same.

-- 
Ronald Fischer <ynnor@mm.st>

Replies are listed 'Best First'.
Re^5: Why do I need parentheses here?
by ikegami (Patriarch) on May 27, 2009 at 15:01 UTC
    /PAT/ (m/PAT/) is the match operator. qr/PAT/ compiles the pattern and returns the pattern without doing any matching. perlop
    $ perl -le'$_="abc"; print /(.)/;' a $ perl -le'$_="abc"; print qr/(.)/;' (?-xism:(.))

      Ah, thanks a lot. I confused this with Ruby.... I should not mix languages too much ;-)

      -- 
      Ronald Fischer <ynnor@mm.st>