in reply to Re^4: CPAN Module for mixing Unix/Windows path
in thread CPAN Module for mixing Unix/Windows path

Either '\' is a path separator or it's not. You can't have it both ways.

If '\' is not a path separator, then it cannot be replaced with '/' and your test did return consistent and expected results, contrary to what you said.

If '\' is a path separator, then it couldn't have been produced by File::Spec on your system and your test is invalid since the OP said that path is produced by File::Spec.

The only system where it's safe or valid to change 'bar\baz' to 'bar/baz' is a Win32 system.

  • Comment on Re^5: CPAN Module for mixing Unix/Windows path