>
> I have a text file with a list of about 56,000 filenames.
> Only the filenames are in this file. I have another 30,000
> or so .cfm and .htm files. I want to use File::Find to cycle
> through EVERY file in EVERY directory line by line (about 2
> million lines in all). Evertime it comes across a reference
> to one of the 56,000 files I have in the list in the htm or
> cfm file it needs to replace it with a lowercase version of
> it. Not touching ANYTHING else.
not exactly sure what you want to do here. File::Find is the right way to
recurse files. you also want to take a look at grep (perldoc -f grep) .
also check the file::find docs closer, i don't see where you actually
provide a dir to file::find
I usually feed dirs to it something like this
wanted(\@paths);
sub wanted
{
do stuff .....
}
>
> CODE BELOW:
> #!/usr/bin/perl -w
> use strict;
> use File::Find;
>
> sub process_files{
> open($FH, "< $_") or die("Error! Couldn't open $_ for
> reading!! Program aborting.\n");
> open($MATCH, "< /home/losttre/match.txt") or die("Error!
> Couldn't open $MATCH for reading!\n");
> open($TEMP, "./temp.dat") or die ("Couldn't open temp file!
> Aborting\n");
>
> @MATCH = <MATCH>;
> @fcontents = <FH>;
>
> foreach $lineitem (@MATCH){
> foreach $lineitem2 (@fcontents){
> if($lineitem == i/$lineitem2/){
> #I ASSUME THIS IS WHERE MY MATCH WOULD HAPPEN AND I
> NEED TO REPLACE THE STRING
> }
> }
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]