Help for this page
foreach my $path ("/a/b/c/d/../../../e" , "/a/../b/./c//d") { my @c= reverse split m@/@, $path; ... } print "/".join("/", reverse @c_new) ."\n"; }