in reply to substitute \ and / with \\ ?

What you want to do doesn't require regular expressions at all. You can do it with a transliteration, using the tr operator

my $path = 'c:\\tmp/sup'; $path =~ tr{/}{\\};

Oops. Sorry, misread the question. Which just goes to show that backslashes are truly the work of the devil.

_____________________________________________
Come to YAPC::Europe 2003 in Paris, 23-25 July 2003.

  • Comment on Re: substitute \ and / with \\ ? (transliteration, not substitution)
  • Download Code