use CGI qw/:standard/; $terms = param(terms); $baseurl = 'http://www.lipscher.com/seth/'; $title = "Seth's Home Search"; $title_url = 'http://www.lipscher.com/seth/'; $search_url = 'http://www.lipscher.com/seth/'; # Get Files To Search Through &get_files; # Search the files &search; # Print Results of Search &return_html; sub get_files { chdir("e:\\"); @dirs = `dir /B`; foreach $folder (@dirs) { if (-T $folder) { @ls = `dir /B $folder\*.htm`; foreach $temp_file (@ls) { push(@FILES,"$folder/$temp_file"); } } } } sub search { @terms = split(/\s+/, $terms); foreach $FILE (@FILES) { open(FILE,"$FILE"); @LINES = ; close(FILE); $string = join(' ',@LINES); $string =~ s/\n//g; foreach $term (@terms) { if (!($string =~ /$term/i)) { $include{$FILE} = 'no'; last; } else { $include{$FILE} = 'yes'; } $titles{$FILE} = "$FILE"; } } } sub return_html { print "Content-type: text/html\n\n"; print "\n \n Results of Search\n \n"; print "\n
\n

Results of Search in $title

\n
\n"; print "Below are the results of your Search in no particular order:


\n"; print "

\n"; print "
\n"; print "Search Information:

\n"; print "



\n"; # print "

\n"; print "
\n"; print "\n\n"; }