The script that I am writing will be used to run a website of a bookstore and at the moment, I am working on the catalog search part.
The script goes to the search part of the srcipt and runs all the lines of it until it seems to stop at some point among the lines:
open(DATA, "books.txt") or die "error opening file $!"; while (<DATA>) { @bookinfo = split(/\|/, $_); chomp(@bookinfo); if ($q{'lang'} eq '' || $bookinfo[1] eq $q{'lang'}) { $matchingwords=0; foreach $word(@search) { if ($_ =~ $word) { $matchBooks[$numMatches] = @bookinfo unless ($matching +words>0); $numMatches++; $matchingwords++; } } } } if (@matchBooks>0) { my $sortby; if ($q{'sort'} eq 'author') {$sortby = 3;} else {$sortby = 2;} @matchBooks = sort {${$a}[$sortby] cmp ${$b}[$sortby]} @matchBooks; my $firstDis; my $lastDis; my $firstDisp; if ($q{'first'}) { $firstDis = $q{'first'}; $firstDisp = $q{'first'};} else { $firstDis = 1; $firstDisp = 1; } if ($firstDis + 9 < $numMatches) {$lastDis = $firstDis + 9;} else {$lastDis = $firstDis + ($numMatches - $firstDis);} $firstDisp = $firstDisp - 1; print '<b>Matching Books</b><br>'; print 'There are '.@matchBooks.' matches.<br>'; print "${firstDis}-${lastDis} are listed below.<br><br>"; print "<nl>"; while ($firstDisp < $lastDis) { ... }
Why is it doing this?
Thanks in advance.
--Zenon Zabinski
In reply to Problem that I can't find by zdog
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |