in reply to Can a Perl Script call another perl script?

Along with the ActiveState distribution comes a tool named search that does just what you need. To use a file as input for that program you can simply use a shell command:
for /f %f in (mylist.txt) do search -name -i *.html -dir c:\intetput\w +wwroot\iprt %f
Look up the docs for for and search by typing for /? and search -help at the command line.

Edit:
There is a trap when it comes to using for loop constructs in batch files. You have to "escape" the % signs in the loop variable (the batch interpreter eats one of them), so above line becomes
for /f %%f in (mylist.txt) do search -name -i *.html -dir c:\intetput\ +wwwroot\iprt %%f


holli, /regexed monk/

Replies are listed 'Best First'.
Re^2: Can a Perl Script call another perl script?
by Anonymous Monk on Jan 30, 2006 at 22:04 UTC
    I ran this command at the DOS prompt:
    for /f %f in (mylist.txt) do search -name -i *.* -dir D:\Temp\PPM9422 %f
    and got this error. What does it mean?
    It looks like it reads the values from mylist.txt but is expecting something else to do the search. Thanks
    D:\Temp\PPM9422>for /f %f in (mylist.txt) do search -i *.* -dir D:\Temp\PPM9422 %f
    D:\Temp\PPM9422>search -i *.* -dir D:\Temp\PPM9422 jury
    C:\Perl\bin\search.bat internal error: Quantifier follows nothing in regex; marked by <-- HERE in m/ * <-- HERE .*/ at (eval 3) line 238.
    D:\Temp\PPM9422>search -i *.* -dir D:\Temp\PPM9422 MSDN
    C:\Perl\bin\search.bat internal error: Quantifier follows nothing in regex; marked by <-- HERE in m/ * <-- HERE .*/ at (eval 3) line 238.
    where search.bat line 238 reads
    if ($arg =~ m/^-(i?)(d?)skip$/) {
    local($i) = $1 eq 'i';
    local($d) = $2 eq 'd';
    $! = 2, die qq/$0: expecting glob arg to -$arg\n/ unless @ARGV;
    foreach (split(/\s+/, shift @ARGV)) {
    if ($d) {
    $idskip{$_}=1 if $i;
    $dskip{$_}=1;
    } else {
    $iskip{$_}=1 if $i;
    $skip{$_}=1;
    }
    } next;
    I did the search -help and could not figure it out. D:\Temp\PPM9422>search -help
    usage: C:\Perl\bin\search.bat options -e PerlRegex ....
    OPTIONS TELLING *WHERE* TO SEARCH:
    -dir DIR start search at the named directory (default is current dir).
    -xdev stay on starting file system.
    -sort sort the files in each directory before processing.
    -nolinks don't follow symbolic links.
    OPTIONS TELLING WHICH FILES TO EVEN CONSIDER:
    -mtime # consider files modified > # days ago (-# for < # days old)
    -newer FILE consider files modified more recently than FILE (also -older)
    -name GLOB consider files whose name matches pattern (also -regex).
    -skip GLOB opposite of -name: identifies files to not consider.
    -path GLOB like -name, but for files whose whole path is described.
    -dpath/-dregex/-dskip versions for selecting or pruning directories.
    -all don't skip any files marked to be skipped by the startup file.
    -x<SPECIAL> (see manual, and/or try -showrc).
    -why report why a file isn't checked (also implied by -vvvv).
    OPTIONS TELLING WHAT TO DO WITH FILES THAT WILL BE CONSIDERED:
    -f | -find just list files (PerlRegex ignored). Default is to grep them.
    -ff | -ffind Does a faster -find (implies -find -all -dorep)
    OPTIONS CONTROLLING HOW THE SEARCH IS DONE (AND WHAT IS PRINTED):
    -l | -list only list files with matches, not the lines themselves.
    -nice | -nnice print more "human readable" output.
    -n prefix each output line with its line number in the file.
    -h don't prefix output lines with file name.
    -u also look "inside" manpage-style underlined text
    -i do case-insensitive searching.
    -w match words only (as defined by perl's \b).
    OTHER OPTIONS: -v, -vv, -vvv various levels of message verbosity.
    -e end of options (in case a regex looks like an option).
    -showrc show what the rc file sets, then exit.
    -norc don't load the rc file.
    -dorep check files with multiple hard links multiple times.
    Use -v -help for more verbose help.
    This script file is also a man page.
      What is the content of "mylist.txt"?
      for /f %f in (mylist.txt) do search -name -i *.* -dir D:\Temp\PPM9422 +%f
      is wrong. That must read
      for /f %f in (mylist.txt) do search -name *.* -i -dir D:\Temp\PPM9422 +%f
      or if you want to search for *.* then you can omit the -name parameter:
      for /f %f in (mylist.txt) do search -i -dir D:\Temp\PPM9422 %f


      holli, /regexed monk/