Gordian knot with File::Find

From: kz (notpublic_at_restricted.com)
Date: 01/22/04


Date: Thu, 22 Jan 2004 14:58:42 +0100

Hi Gurus,

This has been causing me a bad morning today..
What I tried to achieve was a simple search in multiple html files based on
a given pattern
I have the following disk structure on my NT4-based :-( test Web server:

/cgi-bin where my scripts obviously reside
/pages
          /1
          /2
          /3 etc, where my pages reside

 use File::Find;
 find(\&search, "D:/absolute/path/to/pages");
 sub search
{
     if (/.html$/)
     {
         my $filename = $File::Find::name;
         my $pat = "blabla";
# do whatever needed
      }
}

This works just fine and all pages are parsed as needed.
However, I'd prefer relative paths, but if I change the original find to
find(\&cleanup, "../pages");
the script processes only the /pages folder, no subfolders.
Must be simple to solve, but perldoc file::find and google gave no hints
whatsoever.
Why are absolute paths processed differently from relative paths?

Thanks in advance and best regards,

Zoltan Kandi, M. Sc.