"What, exactly, does Dancer buy me?
Hundreds of plugins to do all manner of everything easily, ability to connect to any conceivable backend for data storage, abstraction levels that are extremely remarkable while completely independent, sessions, authentication, trivially simple route handling, significant list of features to incorporate functionality within routes, page redirection, configuration management etc etc.
As 1nickt said, you're looking at HTML templates. Something must be used to display data to your user; the HTML has to be generated somehow. Dancer2 is not limited in scope to just simple forms; it's a full blown framework with one hell of a lot of features, but with that said, extremely simple to get up and going. Look Ma, no webserver setup to test!
App::RPi::EnvUI, a single-page web application to automate indoor grow room environments. Has authentication for all routes that perform db write operations, includes a bunch of JS and CSS in the "views" directory (some off-the-shelf, the rest my own), spins off asynchronous events that performs various actions, has a separate singleton API module, a separate singleton DB module for all backend data storage, sessions, two HTML templates (in "views" dir, one for the main page, the other for statistics) etc. It's a lot more elaborate than a simple web form, but I digress. The lib/App/RPi/EnvUI/EnvUI.pm file is the one that contains the Dancer code.
Once your template/HTML output mechanism is in place, it's all Perl code after that essentially. I use JSON extensively for passing data back and forth between the web front-end and the Perl backend.
To be honest, after quickly reviewing your code snip, it looks like you've created more of an HTML page builder than a web framework (again, after only a cursory glance).
In reply to Re: To Dance or not to Dance with Dancer2? That is the question.
by stevieb
in thread To Dance or not to Dance with Dancer2? That is the question.
by nysus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |