On Fri, Feb 08, 2002 at 09:55:58AM -0800, John wrote:
> Is this the right/best way to do this?  I wanted to use File::Find 
> but couldn't figure out how to exclude directories.  I want to display 
> a directory tree, but I don't want to display the directories called 
> WORKAREA, STAGING, EDITION, or .raw, and I don't want to search those 
> directories for subdirectories either.

It's fairly simple to exclude directories from your search with File::Find. 
In your wanted subroutine use something like:

    if (
        -d &&
        ($_ eq 'WORKAREA' || $_ eq 'STAGING' || $_ eq 'EDITION' || $_ eq '.raw')
    ) {
        $File::Find::prune = 1;
        return;
    }


Michael
--
Administrator                      www.shoebox.net
Programmer, System Administrator   www.gallanttech.com
--

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to