I'm writing my first CGI::Application/HTML::Template application, have spent a few hours Googling and trying things but can't figure out what is wrong. Any help would be appreciated. Thanks!

template:
<form method='post' action='<TMPL_VAR NAME="LOGIN_URL">'> Email Address <input type='text' name='email' size='50' maxlength='80' value='<TMPL_VAR NAME="EMAIL">'> <br><br> Last six digits of SSN <input type='password' name='pin' size='8' maxlength='6' value='<TMPL_VAR NAME="PASSWD">'> <br><br> <input type='hidden' name='rm' value='<TMPL_VAR NAME="RM">'> <input type='submit' name='submit'> </form>
code:
sub form_login { my ( $self ) = @_; my $nextrm = 'authenticate'; # Get CGI query object my $cgi = $self->query(); my $email = $cgi->param('email'); $self->tmpl_path('./'); my $output = $cgi->header(); $output .= $cgi->start_html( -title => 'Employee Login Form' ); my $tmpl_obj = $self->load_tmpl( 'Login.tmpl' ); # $output .= Dumper ( $tmpl_obj ); # print $output; # next line generates the error $tmpl_obj->param( LOGIN_URL => '/cgi-bin/Auth/Auth.cgi', EMAIL => $cgi->param('email'), PASSWD => '', RM => $nextrm, ); $output .= $tmpl_obj->output; $output .= $self->dump_html(); $output .= $cgi->end_html(); return $output; }
The resulting error message is: HTML::Template->param() : You gave me an odd number of parameters to param()! at Auth.pm line 51 If I uncomment the two output lines, I get the following:
<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US"> <head><title>Employee Login Form</title> </head><body>$VAR1 = bless( { 'param_map' => { 'passwd' => bless( do{\(my $o = undef)}, 'HTML::Template::VAR' ), 'email' => bless( do{\(my $o = undef)}, 'HTML::Template::VAR' ), 'rm' => bless( do{\(my $o = undef)}, 'HTML::Template::VAR' ), 'login_url' => bless( do{\(my $o = undef)}, 'HTML::Template::VAR' ) }, 'parse_stack' => [ \' <form method=\'post\' action=\'', $VAR1->{'param_map'}{'login_url'}, \'\'> Email Address <input type=\'text\' name=\'email\' size=\'50\' maxlength=\'80\' value=\'', $VAR1->{'param_map'}{'email'}, \'\'><br><br> Last six digits of SSN <input type=\'password\' name=\'pin\' size=\'8\' maxlength=\'6\' value=\'', $VAR1->{'param_map'}{'passwd'}, \'\'> <br><br> <input type=\'hidden\' name=\'rm\' value=\'', $VAR1->{'param_map'}{'rm'}, \'\'> <input type=\'submit\' name=\'submit\'> </form> ' ], 'options' => { 'memory_debug' => 0, 'double_file_cache' => 0, 'shared_cache' => 0, 'cache_debug' => 0, 'filepath' => 'Login.tmpl', 'global_vars' => 0, 'ipc_max_size' => 0, 'ipc_key' => 'TMPL', 'file_cache_dir_mode' => 448, 'vanguard_compatibility_mode' => 0, 'ipc_segment_size' => 65536, 'loop_context_vars' => 0, 'blind_cache' => 0, 'file_cache_dir' => '', 'debug' => 0, 'die_on_bad_params' => 1, 'stack_debug' => 0, 'ipc_mode' => 438, 'search_path_on_include' => 0, 'double_cache' => 0, 'file_cache' => 0, 'path' => [ './' ], 'strict' => 1, 'timing' => 0, 'shared_cache_debug' => 0, 'associate' => [], 'filename' => 'Login.tmpl', 'case_sensitive' => 0, 'no_includes' => 0, 'cache' => 0, 'max_includes' => 10 }, 'mtime' => 1087914359 }, 'HTML::Template' );

In reply to HTML::Template error message 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.