in reply to cleaning up absolute path without resolving symlinks
sub Resolve { my @stack = $_[0] =~ /^\./ ? split /\/, $ENV{ PWD } : (); join '/', map { ( $_ eq '..' ) ? pop @stack : ( $_ ne '.' ) && ( push @stack, $_); } split /\/, $_[0]; }
-M
Free your mind
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: cleaning up absolute path without resolving symlinks
by chromatic (Archbishop) on Mar 06, 2007 at 20:08 UTC |