in reply to Collapsing paths
canonpath in File::Spec seems to do the trick.
use File::Spec::Functions 'canonpath'; print canonpath('foo/../bar/../baz/'); __END__ baz
lodin
Update: added examplifying code, but see ikegami's reply below.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Collapsing paths
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 | |
|
Re^2: Collapsing paths
by rvosa (Curate) on Dec 05, 2007 at 12:55 UTC |