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:Body should be an array ref or filehandle: <html>...
#!/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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |