s/\/[^\/]*\/\.\.\//\//g
which is exactly what I was looking for... but it doesn't work if there are two together, as in "foo/bar/../../baz/" So, put it in a loop:
1 while $foo =~ s/\/[^\/]*\/\.\.\//\//g;
dan
www.danheller.com
In reply to Re^2: Absolute pathnames from relative?
by argv
in thread Absolute pathnames from relative?
by grantm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |