in reply to Re: Normalized directory paths
in thread Normalized directory paths
Forgive me, but this breaks when $path = "/foo/mik/.hidden". The first regex results in#!/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"; }
Path is now --/foo/mikhidden--
Mik
|
|---|