in reply to Not able to replace to directory paths

In addition to what the Anonymous Monk said, you need to reverse the order of the substitutions, because if you do $line =~s/\\/\//g; before you look for E:\..., you won't find the backslash any longer...

Also, it should be close $OUTPUT (note the $) to get rid of the "used only once" warning.

Replies are listed 'Best First'.
Re^2: Not able to replace to directory paths
by GrandFather (Saint) on Mar 10, 2011 at 22:40 UTC

    Actually the normalisation substitution ($line =~s/\\/\//g;) should be first so that either form of path separator can be used for input and successfully matched later on against a normalised match string using / instead of \.

    True laziness is hard work