in reply to Re: Normalized directory paths
in thread Normalized directory paths

#!/usr/bin/perl -w use strict; my $path = "/foo/mik/../mik/./../mik"; #print "Path is --$path--\n"; $path =~ s!/\.([^.])!$1!g; #print "Path is now --$path--\n"; while ($path =~ m!/\.!) { $path =~ s!/[^\/]+/\.\.!!; # print "Path is now -+$path+-\n"; }
Forgive me, but this breaks when $path = "/foo/mik/.hidden". The first regex results in
Path is now --/foo/mikhidden--

Mik