-----Original Message-----
From: Mr. Shawn H. Corey [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 10, 2006 5:02 AM
To: beginners@perl.org
Subject: Re: backslash on windows

<snip>
>> 
>> myscript.pl -cfg D:\users\config.txt
>> 
>> inside the script, when capturing the config file mentioned above,
the
>> "\" is treated as escape character.
>>


<snip>
>
> Once inside a string, the backslash character is only the backslash
> character (unless you're using the sting as a regular expression).



If you are using the string in a regular expression, then you can avoid
this problem by using \Q and \E

   $fullpath =~ /\Q$path\E/

See perldoc perlop under the section entitled "Quotes and Quote-like
Operators"

If you're using ActiveState, I recommend using the HTML documentation at
Start-->All Programs -->ActivePerl-->Documentation so that you can
search through the documentation.  The perldocs are all under "Core
Documentation".


--
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