Hi,<br>
I am a beginner perl developer. <br>
I am writing a script for pasing all files in a directory with perticular suffix. <br>
I use File::Find but I want to avoid searching in subdirectories. I
tried to use File::Find::prune in "wanted" function. bit it did not
work. So I use a heck <br>
return unless ($File::Find::topdir eq $File::Find::dir); to avoid
processing in sub directories. but this is an inefficient way. I want
to limit search only to first directory level.<br>
Please let me know the efficient way to do it. and any comments/modification on the code would also be appriciated.<br>
Regards<br>
Pankaj <br>
<br>
sub wanted {<br>
    ## dir tree Depth = 1<br>
    return unless ($File::Find::topdir eq $File::Find::dir);<br>
    $fileext= ".cgd";<br>
    if ($_ =~ /$fileext$/) { # $_ contain file base name.<br>
                            
# $ sign at end of pattern looks for<br>
                            
# .lisa suffix<br>
<br>
       $files[$Count] = "$File::Find::name";<br>
       $Count++;<br>
   }<br>
}<br>
<br>