Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Finding directory paths for missing objs

by philipbailey (Chaplain)
on Mar 13, 2011 at 16:51 UTC ( #892962=note: print w/ replies, xml ) Need Help??


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" );


Comment on Re: Finding directory paths for missing objs
Download Code
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.

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://892962]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (15)
As of 2015-07-03 12:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (51 votes), past polls