Hi,

I'm using file::find to (obviously!) find files, but I
want the results to be placed in a text file so I can
send the paths via email to others. Could someone have
a look at this code (granted it might and is messy),
But look at all lines beginning with * (near the
bottom) and tell me why it dumps EVERY file it looks
at into my text file. Any help would be appreciated.
When i just print out the results to the screen, it
works, when I try to put it into a file it doesn't...

Thanx a zill...
ben

#!usr/bin/perl -w
use File::Find;
use File::Basename;

$match=<STDIN>;
chomp($match);

open(MYFILE, $match) || die "Can't open file: $!";
open(DEST,">layerinfo.txt") || die "$!";
while (defined($basename=<MYFILE>)) 
        {
        if ($basename){
                print "Searching for: $basename\n";
                chomp ($basename);      
                find \&wanted, "q:/";
                }
        }


   sub wanted()
 {

* %files = map {$_=>1} $basename;
*  if ($files=/$basename.TAB/i)
*       {print DEST "$File::Find::name\n" };
 
}
close (DEST);
close ($match);



__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to