in reply to Re^2: 2 sed problems
in thread Yet another substitution problem
Given a path actually exists, problem with a solution not actually changing directories is specified in File::Spec/METHODS ...
- canonpath
No physical check on the filesystem, but a logical cleanup of a path.
$cpath = File::Spec->canonpath( $path ) ;Note that this does *not* collapse x/../y sections into y. This is by design. If /foo on your system is a symlink to /bar/baz, then /foo/../quux is actually /bar/quux, not /quux as a naive ../-removal would give you. If you want to do this kind of processing, you probably want "Cwd"'s "realpath()" function to actually traverse the filesystem cleaning up paths like this.
Otherwise, OP should test|improve on AnomalousMonk's and/or graff's solutions.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: 2 substitution problems
by AnomalousMonk (Archbishop) on Mar 28, 2009 at 22:11 UTC | |
by parv (Parson) on Mar 29, 2009 at 03:04 UTC |