Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

CGI App need direction

by diamondsandperls (Beadle)
on Oct 19, 2012 at 21:00 UTC ( #1000048=perlquestion: print w/replies, xml ) Need Help??
diamondsandperls has asked for the wisdom of the Perl Monks concerning the following question:

What my goals are.

1) Have a form at the top of a webpage.
2) Have the data below the form.
3) When user fills out the form and hits submit the page updates appending the page.

Wondering what module etc not really sure of what direction i need to take on this.

Replies are listed 'Best First'.
Re: CGI App need direction
by davido (Archbishop) on Oct 19, 2012 at 23:30 UTC

    This can be trivial as a Mojolicious "lite-app". Don't forget to handle file locking, and be sure to deal gracefully with problems such as failure to open the message file. The whole thing including the rendering template could be done without being golfy in around 78 lines of code (I know because that's what I came up with when I tried it myself), about 1/3rd of which is auto-generated for you when you generate a lite app with the "$ mojo generate lite-app" command. The template that you start with, plus the Mojolicious::Lite POD will lead you along the right path.

    What's probably not quite so trivial is getting over that initial hump of learning how it all works. But really, the documentation for is pretty good, and in particular, if you focus on creating a "lite-app", your first successful attempt might take an hour or two to work through. And then the next time you have to do something similar, it will take a few minutes to toss together.

    Whether you go the Mojolicious route, or Dancer, or even CGI, the first step will be reading the documentation. At that point you'll be able to ask a question that addresses specific areas where you need clarification, rather than "I need the whole thing."


Re: CGI App need direction
by james2vegas (Chaplain) on Oct 19, 2012 at 22:43 UTC
Re: CGI App need direction
by enigma (Novice) on Oct 20, 2012 at 06:31 UTC

    This is a typical case of Ajax call that update your form without actually submitting it.

    I'll suggest you to use any data format like - xml/html/json/...etc. and use the web framework like MASON. Access all field data using JS and pass the values to mason component using ajax call (which is easiest by using jQuery.)

      An AJAX request might fit the OP's requirements, but given how he does not seem to know much of the subject (HTTP, CGI), adding javascript and the DOM to the soup will make the code quite a bit more complex while giving very little benefit. (Slightly smoother page update, and that's it.)

      (Not to mention that for an unfortunately large group of web developers, JS is the hammer they have and everything starts looking like a nail -- it is rife for abuse.)

Re: CGI App need direction
by Anonymous Monk on Oct 20, 2012 at 17:11 UTC
    I don't like to be blunt, but I will be: (1) you don't know what you're doing; (2) find out. Maybe it requires the use of Perl; probably it does not. Plenty of hosting companies are out there, including big ones, including VERY big ones, who have taken just about every routine requirement like this one and made it push-button. But since you don't know what you're doing (yet) you're not going to do anything but smash your own face repeatedly. Quite likely the best solution is to hire someone who actually knows and to watch closely what they have done. Like hiring a handyman one time to save the tips of your own fingers.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1000048]
Front-paged by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2018-02-20 19:52 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (274 votes). Check out past polls.