Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Couple of questions 1.I would like to search for .libs in more than one folder,I tried to use the below syntax,its not working?Cansome pls give me the proper syntax

2.I noticed find is taking lot of time to search if the location am searching for is on a server and if it has multiple recursive directores in it.what is fastest way to find in perl,please advsie

find(sub { push @libs, "$File::Find::name" if -f && /\.lib$/i && !$seen{$F +ile::Find::name}++; }, "$data,$files");

Replies are listed 'Best First'.
Re: Finding in multiple directories
by Anonymous Monk on Jun 28, 2011 at 17:47 UTC
    Have you read perlintro? It explains basic perl syntax, including, passing arguments to functions

    The module File::Find::Rule is easier to use than File::Find

      I couldnt find syntax to search in multiple directories

        Tried the following,its not working,where $data,$files contains two directory names

        my @libs = File::Find::Rule->file() ->name( '*.lib(?:\.\d+)?$' ) ->in( $data,$files );