On 11/13/06, Tim Wolak <[EMAIL PROTECTED]> wrote:
That worked, so basicly what the \Q \E is doing is searching for
non-word characters from the beginning of the line and then stops after
the "E$" in my variable?

Not quite right. \Q \E tell that everything in between should be
interpreted as literal. That's why

   'E$' =~ /\QE$\E/'  # beware the quotes
   "a?" =~ /\Q?\E/

In this vein,   /\QE$\E/  is equivalent to    /E\$/    and /\Q?\E/
to    /\?/. But it works also if you interpolate a variable in the
pattern. So that

$a = 'E$a?';
/\Q$a\E/          makes at runtime a regexp equivalent to      /E\$a\?/

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to