On Wed, Jul 03, 2013 at 10:13:19AM -0700, Robert Freiberger wrote: > Hello everyone,
Hi, > I'm working on a work project where we are moving a few Perl > scripts from a command line to a web page that will allow more > users to access the tool. Basically it's a very simple script > that takes an updated CSV feed, runs a internal test, then > reports back the numbers from the test. > > Ideally, we would like to have this run from a web page instead > of from the command line as more people would like to access > the tool but don't want to give everyone shell access. But the > question is how should we build out this web page? In college I > did some CGI Perl writing but it looks like (I could be wrong) > that this is no longer the standard, and more people recommend > going with Dancer, Mojolicious or Catalyst. > > If anyone could provide suggestions to get started that would > be great. As an ASP Web application developer I am very interested in learning Perl's Web frameworks as much better alternatives. That said, I have been mostly unsuccessful in doing so. Perhaps mostly due to time constraints and lack of motivation. I have made some minor progress with Catalyst though that may help you move forward (or at least evaluate forward). Once you install the Catalyst developer module (e.g., cpanm Catalyst::Devel[1]) you should have a program installed called catalyst.pl which will allow you to create a new "application" skeleton (try the perldoc or --help for guidance with that tool). Once you have that skeleton you can run it using either the generated script/${app_name}_server.pl program within the application skeleton, or by using an external server, such as Starman (to the best of my knowledge, this is sort of the defacto standard "production" server to use; it has a more verbose name too, but Starman is indeed easier to remember ;). Starman isn't the only server option available, and you could probably even wire it up with more tradictional Web servers if you care to, but using Starman is probably the simpler option. You will have to evaluate its worthiness in production and overhead in administration (I haven't come close to this point yet). [1] I'm sort of winging this as it has been several months since I have touched anything to do with Catalyst... Time and motivation.. x( To run an instance of your skeleton application using the Starman server you must first install it (e.g., cpanm Starman). Then run it, passing a path to a .psgi file (which can I guess be thought of as the entry point for the PSGI i.e., Catalyst application). E.g., starman ${app_name}.psgi. That is as far as I have gotten unfortunately... It is based on an MVC structure so it will help to have an understanding of that (coming from ASP I probably have a broken understanding of that, but I digress... >:). All of this said, if others are right and you only have a simple program that will become a single Web page that just needs to run and generate some simple HTML output then it might well be easier to just hack up a CGI program and wire it up with whatever Web server is currently available. Your mileage may vary... And of course, there are many ways to do it. Just take care to sanitize user inputs, whatever you do... Regards, -- Brandon McCaig <bamcc...@gmail.com> <bamcc...@castopulence.org> Castopulence Software <https://www.castopulence.org/> Blog <http://www.bamccaig.com/> perl -E '$_=q{V zrna gur orfg jvgu jung V fnl. }. q{Vg qbrfa'\''g nyjnlf fbhaq gung jnl.}; tr/A-Ma-mN-Zn-z/N-Zn-zA-Ma-m/;say'
signature.asc
Description: Digital signature