Hi Ruud,
On 6/1/06, Dr.Ruud <[EMAIL PROTECTED]> wrote:
"David Romano" schreef:
> [ $pattern = '\w\s\w' ]
> You also need to [...] escape the slashes for the pattern you're
> using
I don't think that is needed:
(1) perl -le '$re = q{\w\s\w} ; print qr/$re/'
(2) perl -le '$re = q{\\w\\s\\w} ; print qr/$re/'
(on Windows you'll need to change the outer quotes to dquotes)
Both will print: (?-xism:\w\s\w).
Try also:
perl -le 'print q{\\w\\s\\w}'
perl -le 'print q{\w\s\w}'
that both print: \w\s\w.
Yep, you're right. Looking at it again, my only excuse is that it was
4 in the morning. When I was writing that, I forgot what I learned
from the Llama book that only \' and \\ work between single-quotes
(thus the suggestion to change "c:\backup.pl" to "c:\\backup.pl"
instead of 'c:\backup.pl'). Thanks again for pointing out where I
erred :-)
David
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>