in reply to Re: Working with references to scalars
in thread Working with references to scalars
I agree that my example wouldn't be a good case of clear coding style, but I was only trying to create a simple example. How I will use it like this:
use HTML::Template(); use HTML::FillInForm(); use CGI(); my $string = '<b><TMPL_VAR test></b>'; my $query = new CGI; my $template = new HTML::Template(scalarref => \$string); my $fif = new HTML::FillInForm; print $fif->fill(scalarref => \$template->output(), fobject => $query);
In this case it clearly states that the fill method expects a reference to a scalar. I prefer the above code over this (the old way I always used)
my $html = $template->output(); print $fif->fill(scalarref => \$html, fobject => $query);
|
|---|