Adriano Allora wrote:
`sort tagged_files/* | uniq > word+tag.txt`;

???

All files in tagged_files/* are unique. This looks like a lot of make work. Try File::Find instead. See `perldoc File::Find`.

open(IDX, "<word+tag.txt");
while(<IDX>)
        {
        next if /^\W.+/;
        open(TMP, ">indexes/$_.txt");
        $where = `grep -L '$_' tagged_files/*`;

This says you are looking for the file _NOT_ in the files' content. Perhaps you want '-l' instead? See `man grep`.

        print TMP $where;
        close(TMP);
        }

someone would tell me why the line with grep does not work?
Is this the fastest way?

Considering the amount of work this does outside of Perl, no. A shell script would be faster. (But, of course, anything written in Perl is automatically better than everything else ;)


--

Just my 0.00000002 million dollars worth,
   --- Shawn

"Probability is now one. Any problems that are left are your own."
   SS Heart of Gold, _The Hitchhiker's Guide to the Galaxy_

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to