in reply to Escape from backslash hell

Wow, at least 4 replies and all are off base. When you want to substitute characters with different ones you need to use tr aka y (see perlop).
#untested but should work $dt =~ y{/}{\\/}; #or $dt =~ tr{/}{\\/};
update: Bravo! You are soooo right! Glad to see some quality control here. I don't know why that "escaped" me, but hey, it is a valuable learning experience to realize that not all monks know what they are talking, and that you have to check out their references (like I should've done). Live and learn, and then go crazy.

 
___crazyinsomniac_______________________________________
Disclaimer: Don't blame. It came from inside the void

perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;"

Replies are listed 'Best First'.
Re: (crazyinsomniac) Re: Escape from backslash hell
by impossiblerobot (Deacon) on Dec 01, 2001 at 07:12 UTC
    I don't think this will work, since (AFAIK) tr can only translate a single character to another single character.

    Impossible Robot