You have a number of potention pitfalls in this script. The first is that you are not correctly using HTML::Template by generating HTML that should be encapsulated into a template file. A good rule of thumb is, if you print any HTML in your script whatsoever, such as
$Template->param(Results => "<p>Results: $shtuff<\/p>");
or
print <<HTMLSTUFF; <html> <head> <title>No file</title> ...
you are using it wrong. To correct the first example, only pass a variable (such as the less offensive $shtuff scalar) and do not pass any HTML - the template should contain the markup, not the script. To correct the second example, place everything in the heredoc into a template file.

Also, this:

my $Template = HTML::Template->new( filename => '../Template/Search_Engine.tmpl' );
is very non-portable. You specify a full path to the file instead of using dot dot.

Please read HTML::Template Tutorial - it will take you less time to read it then it took me to write it, and you will be better off after having worked through the examples it presents.

Last note, this:

#The secret ingredient! use lib "../lib"; use HTML::Template;
Is a non-portable hack that can be improved by reading A Guide to Installing Modules, specifically this section.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

In reply to (jeffa) Re: Problem using HTML::Template. by jeffa
in thread Problem using HTML::Template. by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.