http://www.perlmonks.org?node_id=892962


in reply to Finding directory paths for missing objs

As suggested by jethro in your previous thread (Finding missing libs in a directory), File::Find can achieve your requirements:

#!/usr/bin/perl use warnings; use strict; use File::Find; find(sub { if (-d and /[oa]-le-v7(-g)?$/) { print "No matching files in $File::Find::dir/$_\n" unless +grep { /\.(o|a|so)$/ } glob "$_/*"; } }, "testdir" );

Replies are listed 'Best First'.
Re^2: Finding directory paths for missing objs
by Anonymous Monk on Mar 13, 2011 at 18:45 UTC

    what is "test dir" for?does the script search for recursive directories?.I removed "test dir" and running into the following error invalid top directory at C:/Perl/lib/File/Find.pm line 295.

      Never mind,I figured out.Thanks for your help.

Re^2: Finding directory paths for missing objs
by Anonymous Monk on Mar 13, 2011 at 18:42 UTC

    what is "test dir" for?does the script search for recursive directories?

      "testdir" is the directory where I created test directories and files. You should replace with the root of the directory tree you wish to search. Yes, File::Find does perform a recursive search.