Fishcake2000 has asked for the wisdom of the Perl Monks concerning the following question:
dir /s listing:c:\perl
I need:c:\perl\bin\aa.exe c:\perl\doc\bb.txt c:\perl\web\index.html
current unworking code:bin\aa.exe doc\bb.txt web\index.html
open(GETDIR, "cd |"); while(<GETDIR>) { chomp; $currentDir = $_; } open(DODIR, "dir /b /s|"); while(<DODIR>) { chomp; $pathRemoved = $_; $pathRemoved =~ s/$currentDir//i; print $pathRemoved; }
Originally posted as a Categorized Question.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How do I remove current path from a dir listing
by tye (Sage) on Oct 06, 2000 at 19:05 UTC | |
|
Re: How do I remove current path from a dir listing
by t0mas (Priest) on Oct 06, 2000 at 16:07 UTC |