use File::Find; my $ig=0; find( {wanted=>\&del, bydepth=>1, postprocess=>\&dirp}, 'E:\Documents and Settings\vijay\test'); ###### sub del{ # $ig is set to 1 if this is a DIRECTORY $ig==1 and return $ig=0; # Reset it ## Use the $ig toggle to do a REMDIR, before returning print qq($_ \n); ## Remove (Unlink) the $_ file here .... } #### sub dirp{ # Called for DIRECTORIES only print qq(***DIR:$File::Find::dir\n); $ig=1; }