How can I remove relative path components but leave symlinks alone in Perl?
- by jnylen
I need to get Perl to remove relative path components from a Linux path. I've found a couple of functions that almost do what I want, but:
File::Spec->rel2abs does too little. It does not resolve ".." into a directory properly.
Cwd::realpath does too much. It resolves all symbolic links in the path, which I do not want.
Perhaps the best…