c:\perl #### c:\perl\bin\aa.exe c:\perl\doc\bb.txt c:\perl\web\index.html #### bin\aa.exe doc\bb.txt web\index.html #### open(GETDIR, "cd |"); while() { chomp; $currentDir = $_; } open(DODIR, "dir /b /s|"); while() { chomp; $pathRemoved = $_; $pathRemoved =~ s/$currentDir//i; print $pathRemoved; }