i need help using File::Find::name

Newbie Member
4Dec2008,01:15   #1
harkki's Avatar
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
Team Leader
10Dec2008,16:13   #2
pradeep's Avatar
What problem are you facing with your script?