http://www.perlmonks.org?node_id=655073

rvosa has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

I am trying to figure out how to go from a path such as foo/../bar/../baz/ to baz/. I hope I figured out the example correctly, but you see what I mean: collapse the up-and-down again stuff into a neat straight path. I read the pod for File::Spec three times over expecting it to be there but I don't see it. How do I do this without dodgy regexes?

Thanks!