canonpath in File::Spec seems to do the trick.
Did you try it out?
#!/usr/bin/perl use File::Spec; print File::Spec->canonpath("foo/../bar/../baz/")."\n";
Output:
foo/../bar/../baz
I guess not. Did you read the docs? Quote:
Note that this does *not* collapse x/../y sections into y. This is by design.I guess not.
In reply to Re^2: Collapsing paths
by tirwhan
in thread Collapsing paths
by rvosa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |