[cgiapp] Re: my action subroutines all return references, which get stringified

Terrence Brannon tbrannon at insuranceagents.com
Tue Jan 27 13:28:22 EST 2009


On Tue, Jan 27, 2009 at 1:22 PM, Terrence Brannon <
tbrannon at insuranceagents.com> wrote:

> My action routines are returning subclasses of HTML::Tree, which I then
> turn into strings in my cgiapp_postrun method like so:
>
> sub cgiapp_postrun {
>   my ($self, $html_tree) = @_;
>
>   return $$html_tree->stringify() ;
> }
>
>
aha! if only I would read the docs... i'm supposed to alter the input body
if I want change, not just return what I want... this works just fine:

 sub cgiapp_postrun {
  my ($self, $html_tree) = @_;

  $$html_tree = ref ${$html_tree} ? ${$html_tree}->stringify() : $$html_tree
;

}


More information about the cgiapp mailing list