Ok, here's (I hope) a little clarification.
here's a big snipet of code
my @dat_files = <$board_dir/*.dat>;
$q = 0;
foreach (@dat_files) {
$number;
$number = $_;
$number =~ s/\/var\/www\/cgi-bin\/2930forum\/data\///g;
$number =~ s/\.dat//g;
open THREAD, "$_" or die "Can't open .dat file: $!";
$x = 0;
while (<THREAD>) {
$thread_data[$x] = $_;
$x++;
}
close THREAD;
foreach (@thread_data) {
@details = split /\|/, $_;
if ($details[4] =~ m/\Q$in{for}\E/i) {
$found[$q] = $number;
$q++;
}
}
}
It's a little sploppy at this point, but I'm just trying to get valid results at this point, I'll clean it up later.
$in{for}: is defined my form input (I've been using simple searches like "cheese")
$thread_data[4]: is the messages posted in every thread. I could potentially contain just about anything except empty.
$thread_data[0]: I just realized isn't used. Insted it's $number. Which is just a number string denoting the thread number
I do the search and get results. Some of the threads contain the searchword $in{for} and others do not. For example I put in $in{for} = cheese
and get around 30 results containing messages like:
Hard work pays off after time, but lazyness always pays off now.
One thing I just noticed is that many of the results are in numerical order. for example I get results like 121, 122, 124, 125, 126, 127, 128, 129, 21, 282 ,321, 343, 344, 345, etc
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.