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
In reply to RE: Re: Normalized directory paths
by mikfire
in thread Normalized directory paths
by mikfire
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |