<?xml version="1.0" encoding="windows-1252"?>
<node id="1007306" title="Help, directories?" created="2012-12-05 09:59:04" updated="2012-12-05 09:59:04">
<type id="115">
perlquestion</type>
<author id="961">
Anonymous Monk</author>
<data>
<field name="doctext">
&lt;p&gt;
Dear PerlMonks, &lt;br&gt;
I'm using the module Search::VectorSpace to query a list of documents and return the relevant documents.
the description given in the module is as follows:-
&lt;code&gt;
 use Search::VectorSpace;
        
        my @docs = ...;
        my $engine = Search::VectorSpace-&gt;new( docs =&gt;\@docs, threshold =&gt; .04);
        $engine-&gt;build_index();
        
        while ( my $query = &lt;&gt; ) {
                my %results = $engine-&gt;search( $query );
                print join "\n", keys %results;
&lt;/code&gt;
I have given a list of documents:-
&lt;code&gt;
  $dr="C:\\Users\\Desktop\\collection2";
    opendir(DR, "$dr") || die "error" ;
    @docs=&lt;DR&gt;;
    @docs=readdir DR;
&lt;/code&gt;
But the search is done only on the file names, but not the contents of the file. How do I search for something within the files of the given directory?
&lt;/p&gt;</field>
<field name="reputation">
-1</field>
</data>
</node>
