annie has asked for the wisdom of the Perl Monks concerning the following question:

What am I doing wrong? I'm trying to grab all the directories that don't begin with _<somestuff>, but I don't seem to be filtering right:
my @subdir = File::Find::Rule ->directory ->not_name('*_vti_*','*_templates*','*_themes*','*_ove +rlay*','*_borders*') ->in($webpages);
I've also tried this, which didn't do much better:
my @subdir = File::Find::Rule ->directory ->not_name(qr/\Q_vti_\E/,qr/\Q_templates\E/,qr/\Q_th +emes\E/,qr/\Q_overlay\E/,qr/\Q_borders\E/) ->in($webpages);
Now, when I was just trying to filter out one of those directories, the latter worked. But multiple ones don't seem to.

update (broquaint): title change (was File::Find::Rule)

Replies are listed 'Best First'.
Re: Issues with File::Find::Rule 'not_name' rule
by dragonchild (Archbishop) on Aug 19, 2003 at 19:46 UTC
    Untested: Try ->not_name(qr/_vti_|_template_/) and see if that starts you down the right path.

    ------
    We are the carpenters and bricklayers of the Information Age.

    The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6

    Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

      Thanks! That did it! Anne
      <sigh!> I spoke to hastily. It didn't work.