I Can't make scalarref work!?

  • Lars Sjölund
    Lars Sjölund

    If I use filename it works as expected, but I want to load the user template in $MALL and strip comments and convert extended chars (like )
    use HTML::Template;
    # open the html template
    $MALL = &load_include('../www/tmpl/hemsida.inc');
    # here comments are stripped and chars converted #
    # Assign it to new Template
    my $template = HTML::Template->new(scalarref => $MALL);
    I've tried the 3 different ways..
    I'm I doing something wrong?

    • Sam Tregar
      Sam Tregar

      It looks to me like you're not passing a scalarref!  Try:

      my $template = HTML::Template->new(scalarref => \$MALL);