in reply to Escape from backslash hell

Try using a different delimiter for the substitution other than "/". That tends to help cut down confusion when working with patterns that contain "/"'s.
my $dt = '11/29/2001'; $dt =~ s|\/|\\/|g; print qq($dt);

Rich36
There's more than one way to screw it up...

Replies are listed 'Best First'.
Re (tilly) 2: Escape from backslash hell
by tilly (Archbishop) on Dec 01, 2001 at 08:04 UTC
    If you are going to avoid "leaning toothpicks" by using a different delimiter, then you might as well drop all of the useless ones:
    s:/:\\/:g;
    (Note that I don't like using metacharacters which are meaningful within a substitution. Hence my avoiding the pipes.)