in reply to search all folder except certain folders

From the File::Find perldoc, you'll want to do create a sub that'll filter out the winnt folder from the list of files, e.g.
sub filter { return (grep !/winnt/i, @_); }
and pass that code reference under the hash key preprocess as the first parameter to find. I believe this should do what you want. I hope this helps..

Replies are listed 'Best First'.
Re: Re: search all folder except certain folders
by kirk123 (Beadle) on Apr 21, 2003 at 23:45 UTC
    This is not what I wanted. Here a snippet of my code.
    finddepth (\&rename_file_dir , "c:\\" ); sub rename_file_dir { if( /(.*)csscs_ref(.*)/i )# any files or directories { $orig = $File::Find::name ; $concat = $File::Find::dir . "\/$1$new_hostname$2"; rename($orig, $concat) || print "error can't rename $orig to + $concat: $!" } } How can I rewrite the subroutine so that the script looks for all file + that has the substring "csscs_ref" but not in the 'c:\\WINNT' folder +.
    --thanks