in reply to Re^2: Use of HTML::Template
in thread Use of HTML::Template

A place holder for any of the optional parameters to the new method. Sorta like saying ...->new (foo => 'bar', boo => 'baz', ...). The 'scalerref' option is the interesting one and you can remove the commented line without any nasty surprises.


Perl's payment curve coincides with its learning curve.

Replies are listed 'Best First'.
Re^4: Use of HTML::Template
by Anonymous Monk on Feb 08, 2009 at 09:19 UTC
    Thanks again.

    So if I want to use that for merging all the variables of a page, could I do it like this:
    my $template = HTML::Template->new( scalarref => $html_content, %_array_of_fields ); );

    Where
    %_array_of_fields = ( 'option' => "$option", 'option2' => "$option2", 'option3' => "$someOtherOptionVariable", );
    would that work?

    Thank you

      Unfortunately no. According to my reading of the documentation you must use param () to set parameters:

      my $template = HTML::Template->new( scalarref => $html_content); $template->param (%_array_of_fields);

      Perl's payment curve coincides with its learning curve.