I'm converting an existing CGI style app from Apache/CGI to Starman/PSGI, and am running into trouble. The specific error I'm getting is:
Body should be an array ref or filehandle: <html>...
And my problem is that the ensuing stacktrace doesn't give me the problem starting point within my code. Does anyone have a pointer to a good debugger for plack? I've seen references for one of the REST (browser based) plugins. I'm just curious what people think is a good solution for apps that don't require a ton of setup. Thanks for pointing out an interesting feature of PLACK while requesting an example of my code. Below, please find the snippet from my code which isn't working:
#!/usr/bin/perl use strict; use Plack::Request; use Plack::Builder; use Plack::App::File; use HTML::Template; my $app = sub{ my $env = shift; my $html = get_html(); my $request = Plack::Request->new($env); if($request->param('file')){ $html = thankyou(); } return ['200', ['Content-Type'=>'text/html'],[$html]]; }; sub get_html{ # open the html template my $template = HTML::Template->new(filename => 'scriptup.html'); return $template->output(); } sub thankyou{ return <<HTML; <html><body>Thanks!</body></html> HTML }

In reply to New Plack App (with HTML::Template & file upload) help by Evan Carew

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.