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!
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!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Collapsing paths
by tirwhan (Abbot) on Dec 05, 2007 at 12:45 UTC | |
by rvosa (Curate) on Dec 05, 2007 at 18:59 UTC | |
Re: Collapsing paths
by merlyn (Sage) on Dec 05, 2007 at 17:02 UTC | |
by rvosa (Curate) on Dec 05, 2007 at 19:03 UTC | |
Re: Collapsing paths
by shmem (Chancellor) on Dec 05, 2007 at 14:44 UTC | |
Re: Collapsing paths
by oha (Friar) on Dec 05, 2007 at 12:52 UTC | |
by ikegami (Patriarch) on Dec 05, 2007 at 21:53 UTC | |
Re: Collapsing paths
by johngg (Canon) on Dec 05, 2007 at 14:34 UTC | |
Re: Collapsing paths
by lodin (Hermit) on Dec 05, 2007 at 12:45 UTC | |
by tirwhan (Abbot) on Dec 05, 2007 at 12:52 UTC | |
by ikegami (Patriarch) on Dec 05, 2007 at 16:57 UTC | |
by lodin (Hermit) on Dec 05, 2007 at 20:34 UTC | |
by rvosa (Curate) on Dec 05, 2007 at 12:55 UTC |
Back to
Seekers of Perl Wisdom