use File::Spec; print File::Spec->canonpath("foo/../bar/../baz/")."\n";
\baz
On system without symlinks, canonpath collapses x/../y (although not always correctly, as shown above).
Update: Technically, NTFS does have symlinks, but most software act as if they don't exist, including File::Spec.
In reply to Re^3: Collapsing paths
by ikegami
in thread Collapsing paths
by rvosa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |