in reply to Do I need to give a flock?

You will save yourself a lot of work by using a Herepage. You can interpolate variables into them but do not have to \ your ". This save lots of calls to print and makes your code so much easier to read. Here is an example:

sub unindent; # declare unindent proto at top of code so we can use it + as a bareword sub return_html { my %include = %{$_[0]}; open(FH,"/home/coolsite/www/top.html") || die "couldn't open file +$!"; my @html=<FH>; close(FH); my %titles = %{$_[1]}; my $results; foreach my $key (keys %include) { if ($include{$key} eq 'yes') { $results .= "<li class=bullets><span class=bullets><a href=\ +"$baseurl$key\">$titles{$key}</a></span></li>"; } } print unindent <<" HTML"; # print all the stuff until we find H +TML on a line by itself Content-type: text/html @html <center> <h1>Search Results</h1> </center> RESULTS- In No Particular Order:<p><hr size=7 width=75%><p> <ul> $results </ul> </ul> <br> <hr size=7 width=75%> <P> <ul> <li class=bullets><span class=bullets><a href="$search_url">Back + to Search Page</a></span></li> <li class=bullets><span class=bullets><a href="$title_url">$titl +e</a></span></li> </ul> <hr size=7 width=75%> <center> This search powered by<br> <a href=http://www.mysite.com><img src=../nolalogo.jpg width=318 + height=74 border=0 alt=\"Got Funk?\"></a> </center> </body> </html> HTML # herepage ends with token above } # this sub strips all leading whitespace sub unindent { s/^[ \t]+//gm for @_; @_; }

This uses a trick to let you indent your HTML with the sub. The herepage token we use has 4 leading spaces then the letters HTML ie "    HTML" so indents with the HTML. To remove the indentation for efficiency we declare an unindent() sub proto at the top of our code so we can use it as a bareword (effectively like an inbuilt function). This sub strips all the leading whitespace and will reduce the download by 20-50%+ plus depending on how you format your HTML.

PS you have an extra/unmatched </ul> in there which is a little easier to see now too.

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print