I need to some code that will get the current directory and then remove it from a directory listing that includes sub directorys. i.e:
current dir:
c:\perl
dir /s listing:
c:\perl\bin\aa.exe
c:\perl\doc\bb.txt
c:\perl\web\index.html
I need:
bin\aa.exe
doc\bb.txt
web\index.html
current unworking code:
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.