$ perl -e '$foo = "/some/path/to/a/file"; $foo =~ tr|/|x|c; print "$foo\n";' /xxxx/xxxx/xx/x/xxxx