Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Perl (http://www.go4expert.com/forums/perl/)
-   -   i need help using File::Find::name (http://www.go4expert.com/forums/i-help-using-filefindname-t15388/)

harkki 4Dec2008 01:15

i need help using File::Find::name
 
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

pradeep 10Dec2008 16:13

Re: i need help using File::Find::name
 
What problem are you facing with your script?


All times are GMT +5.5. The time now is 18:16.