How can I frame a rule to achieve this?

By adapting the examples in the File::Find::Rule documentation to your needs. Did you actually read the documentation? You set up a @exclude_dirs with qw(OLD). And? what for? you don't use it anywhere.

A recipe to exclude a directory is in the documentation under the sub-heading "Further examples" following "ignore CVS directories".

Your code looks like whipped up to provide at least something to fend off the "no code" argument; but you seem to be trying to use The Monastery as a coding service, which it is not.

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

In reply to Re: perl - File::Find::Rule to exclude a single dir by shmem
in thread perl - File::Find::Rule to exclude a single dir by sravs448

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.