i need help using File::Find::name

harkki's Avatar, Join Date: Apr 2006
Newbie Member
Hi

i'm very new at perl. i have tried to create a script that reads information(filenames) from txt file and then tries to find if there are matching filenames in certain directoyry and print them out. oh and it has to print the filenames out with their paths. So i have thinking to use this "File::Find::name" that perl has.

I have started it with something like this:

use File::stat;
use File::Find;

find(\&wantedfiles, "/a"); # Get list of all changed files

sub wantedfiles{

$file = "/srcfiles.txt"; # path to the txt where filenames are
open(INPUTFILE, $file); # Open the file
@lines = <INPUTFILE>; # Read it into an array
close(INPUTFILE);

foreach $file (@lines) {
print "$File::Find::name \n" if "$_" eq "$file";
}

}



if some one could give me some pointers or something to work with, i would preciate it very much.

Br,
H.P
0
pradeep's Avatar, Join Date: Apr 2005
Team Leader
What problem are you facing with your script?