in reply to (tye)Re: I think I'm starting to get it
in thread I think I'm starting to get it

Am I missing something...
$str= quotemeta 'C:\Windows'; if ( $path =~ /^$str/i ) { ...
or...

is that not a bit easier on the eyes :)

As long as you use single quotes for $str it can stay readable...

cLive ;-)

Replies are listed 'Best First'.
(tye)Re2: I think I'm starting to get it
by tye (Sage) on Apr 04, 2001 at 23:55 UTC

    That is (mostly) fine too.

    I prefer to tell the regex that I want it to treat the string as a string rather than transform the string into a regex that matches the old string, but most of my freinds know that I'm wierd.

    I also find that getting in the habit of using a single \ inside of single quotes is likely to bite you when you get used to it and try '\\server\share\dir' and can't figure out why you aren't finding those files.

            - tye (but my friends call me "Tye")