my $perl_path = '/foo/bar/baz'; (my $win_path = $perl_path) =~ tr!/!\\!; print "Perl still sees: $perl_path\n"; print "But we can print: $win_path\n";