Most serene masters,
I have, with your help, made this search engine which is working wonderfully. I come to you to ask if the file called top.html below needs to be flocked during the execution of the sub. I believe it does not, but I wanted to be sure. Since I am not writing to the HTML file when I append the search results, will multiple simultaneous executions be a problem?
TIA
jg
PS Yes I know I am not making the most of CGI here.
sub return_html {
my %include = %{$_[0]};
open(FH,"/home/coolsite/www/top.html") || die "couldn't open file $
+!\n";
my @html=<FH>;
close(FH);
print "Content-type: text/html\n\n";
print @html;
my %titles = %{$_[1]};
print "\n <center>\n <h1>Search Results</h1>\n </center>\n";
print "RESULTS- In No Particular Order:<p><hr size=7 width=75%><p>\
+n";
print "<ul>\n";
foreach my $key (keys %include) {
if ($include{$key} eq 'yes') {
print "<li class=bullets><span class=bullets><a href=\"$baseu
+rl$key\">$titles{$key}</a></span></li>\n";
}
}
print "</ul>\n";
print "\n";
print "</ul><br><hr size=7 width=75%><P>\n";
print "<ul>\n<li class=bullets><span class=bullets><a href=\"$searc
+h_url\">Back to Search Page</a></span></li>\n";
print "<li class=bullets><span class=bullets><a href=\"$title_url\"
+>$title</a></span></li>\n";
print "</ul>\n";
print "<hr size=7 width=75%>\n";
print "<center>\n";
print "This search powered by<br>\n";
print "<a href=http://www.mysite.com><img src=../nolalogo.jpg width
+=318 height=74 border=0 alt=\"Got Funk?\"></a>\n";
print "</center>\n";
print "</body>\n</html>\n";
_____________________________________________________Ain't no time to hate! Barely time to wait! ~RH
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.