in reply to Finding missing libs in a directory

Use File::Find, for every dir you find, check if the corresponding file is in it.
  • Comment on Re: Finding missing libs in a directory

Replies are listed 'Best First'.
Re^2: Finding missing libs in a directory
by Anonymous Monk on Mar 11, 2011 at 23:44 UTC

    Can someone give me a starting point?I am very very new to perl.Basically every directory which starts with "o-le-v7" and "a-le-v7" should have one of *.so,*.o,*.a,if they are not present print the directory

      What have you done so far? Where do you have problems? Do you know how to write a loop? Do you have a perl book at hand or some other documentation to find suitable functions and methods for your problem? Can you write a script that shows what you already know how to do?

      Here a few more pointers:

      If a string starts with some other string, you might use substr() and string equality operator 'eq' or a regular expression, i.e. if ( $x=~/o-le-v7/) { ... }

      To read the contents of a directory, you might use glob() or File::Find (if you want to search subdirectories as well), or readdir()

      With the operator '-d' you can find out if some file is a directory, i.e.  if (-d $file) { ... }