in reply to regex error
> It's OK when I type directly not using a string var.
Different things!
> $binpath="c:\\qa\\kontor\\bin"
here you are backslashing to avoid string-interpolation within "doublequotes"
> if( $ENV{PATH} !~ /c:\\qa\\kontor\\bin/i)
here you are backslashing to avoid special escape \commands like \k
So in your code you need 2 levels of escapes!
$binpath="c:\\\\qa\\\\kontor\\\\bin";
Do better combine 'singlequotes' and quotemeta \Q and you avoid any explicit backslashing.
Cheers Rolf
( addicted to the Perl Programming Language)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: regex error (backslashing)
by anaconda_wly (Scribe) on Apr 07, 2013 at 07:58 UTC |
In Section
Seekers of Perl Wisdom