"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

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.