Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

CGI and System Administration

by pileofrogs (Priest)
on Apr 04, 2008 at 17:18 UTC ( [id://678413]=perlquestion: print w/replies, xml ) Need Help??

pileofrogs has asked for the wisdom of the Perl Monks concerning the following question:

Yesteday my boss told me I'm in charge of web accounts for faculty and staff at the school where I work. No problem sez I, but they ain't talking to me on the @#$% phone. They're filling out a web form.

I'm thinking web form with nice friendly javascript to keep the data predictable submitting to a CGI that verifies the crap out of the data before submitting it to a suid c program that again verifies the crap out of the data and then does the actual account changes.

Oh, yeah, I'm in linux here.

I really don't want to spend any more time coding HTML or predictable CGI code than I have to. I'd like to use a good framework with MVC or other nifty acronyms. Something approaching Ruby on Rails but doesn't a) take 15 minutes to load and b) doesn't freak out if your noun is the same in plural as singular (If you've played with Ruby on Rails, you know what I'm talking about...). Of course, I want to do any coding in perl. Hence me positing here on perlmonks... instead of across the street at visualbasicnuns or wherever those poor unfortunates go to seek solace.

So! Actual question! What's the state of the art as far as perl based web development frameworks? Catalyst? Mason? TT? Other?

Thanks!
-Pileofrogs

Replies are listed 'Best First'.
Re: CGI and System Administration
by dragonchild (Archbishop) on Apr 04, 2008 at 17:22 UTC
    Catalyst, Template Toolkit, and DBIx::Class (if you need a DB connection) is the "start of the art". Moose for all object stuff. Selenium for testing the JS. Dojo for your JS toolkit. :-)

    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

      I am going to beg to differ on Dojo. Anything that requires you to break standards to use it (Dojo requires non-XHTML attributes) is broken out of the box. Also, I don't know about the current version but earlier versions have the worst documentation of any software I've ever tried to use; including the fact that the version number is nowhere in the code so it's hard to even know which missing docs to try to find. YUI has nice tech docs and a big community. Ext JS is a pretty fork off it. jQuery, to me, is the most Perl like hitting the sweet spot of syntax and brevity, and it has, in just two years, spawned about 600 known plugins (alla CPAN) and probably another 600 you can find on your own. Its Google groups are very active, 100 posts per day on the main one. There are others too, like Mootools and MochiKit. (Update: Prototype is probably not on the list of good choices.)

        I used Dojo quite extensively for a year and I never used a non-XHTML attribute. That's only one way of using it.

        My criteria for good software:
        1. Does it work?
        2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
Re: CGI and System Administration
by perrin (Chancellor) on Apr 04, 2008 at 18:05 UTC
    For a lightweight MVC framework that you can get going with very quickly, I like CGI::Application. Although it's not as quick to pick up as CGI::Application, Rose::DB::Object is a great tool for flexible object-oriented access to databases and the docs and support are excellent. It's a good M in your MVC. For the V, working with TT has always been a pleasure.

    You will probably also want to look at Data::FormValidator and the amazing HTML::FillInForm.

Re: CGI and System Administration
by mr_mischief (Monsignor) on Apr 04, 2008 at 17:47 UTC
    I'll answer your meta question with some meta questions.

    What system management toolkits have you looked into? Is there something specific you need to do that is not covered by any of cPanel (commercial), Plesk (commercial), Webmin+Usermin+Virtualmin, VishwaKarma, SysCP, WebCP, or others?

    If you're not looking for work already done, is there a reason for that?

    Perl is great, but many of the available tools to do these things are written in PHP. Some can still have Perl-based extensions and plugins. Would that be alright for your needs?

      See my reply to zentara above.

      A tool that can do what I need, including easily customizable in the ways I need, can be written in COBOL for all I care. If I'm going to be writing code, though, I'd prefer perl. Wouldn't say "no" to others if the framework is really that much better than the perl equivalent.

      Thanks!

Re: CGI and System Administration
by zentara (Archbishop) on Apr 04, 2008 at 17:35 UTC

      Wrong wheel.

      I need a form that users can fill out to generate/activate their own accounts. I don't want to deal with them. Laziness!

      Also, we have some requirements that are somewhat non-standard. If there is an appropriate wheel already out there that can be customized enough for our needs (unusual home dir layout, strange addwebuser script, funny authentication mechanism etc...) then I'd love to hear about it.

        Those three things should be really easy to customize in, for example, cPanel.

        The unusual home directory layout should be easy with anything that uses the system's user management tools, too, since typically you can just mess with the skeleton home directory to your heart's content.

        Most web control panels can use PAM, LDAP, XML of some sort, MySQL, PostgreSQL, or some other source you can configure. PAM can be configured to use about anything itself.

        The addwebuser script might be an issue depending on just what you mena by "strange". Chances are there's a suitable way to import the existing users into whatever control panel you end up using.

Re: CGI and System Administration
by Khen1950fx (Canon) on Apr 04, 2008 at 19:04 UTC
    The guys in the audio and music department at the BBC have developed a Perl mvc designed on top of Rails. They didn't say which mvc they used, but it sounds interesting. Here's their blog: Perl on Rails.
Re: CGI and System Administration
by spork (Monk) on Apr 04, 2008 at 21:44 UTC
    I agree with perin. We use CGI::Application and I find it easy to learn, easy to use and quick to start and get something working.

    As for templating the default for C::A is HTML::Template which is what we use. It is very simple and straight forward (and is technically more pure MVC as it keeps logic out of the template). Template Toolkit has much power and is easy to incorporate in C::A as well.

Re: CGI and System Administration
by kyle (Abbot) on Apr 04, 2008 at 17:45 UTC

    Through my early experience with Catalyst, I found CGI::FormBuilder, which makes the validation you mentioned really easy. There's a nice integration with Catalyst if you go that route, but I'd still recommend giving it a try even if you don't use Catalyst.

Re: CGI and System Administration
by stark (Pilgrim) on Apr 04, 2008 at 20:28 UTC
    Nobody mentioned Jifty... ok - it does the plural thing.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://678413]
Approved by pc88mxer
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-03-29 10:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found