Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

jlongino's scratchpad

by jlongino (Parson)
on Jun 13, 2004 at 13:56 UTC ( #363830=scratchpad: print w/ replies, xml ) Need Help??

I'd never used C::A before--though I did play with a single script, application model based on the docs. The primary reasons I want to use it is for code simplification (or at least clarity), module reuse (particularly authentication) and to hide alot of mundane cgi chores. I almost immediately realized that in order to reuse modules, I was going to have to link multiple C::As together and didn't have a clue how or where to start.

I think that if you start with the example framework from the Why CGI::Application? node, sparsely document a few of the magic statements (see the paragraph above) and then flesh out a little more of the subroutines you'll have a excellent start.

I realize you were assuming the poster was to fill in missing details, but many C::A novices (myself included) could use a few explanations or further details regarding the following:

  • How do you get to the validate sub? It would help the novice to see where the run mode should be changed or a "$self->validate;" statement included (for all run modes).
  • Include a brief example of what the cgi script that invokes the Applications looks like. Will it look exactly like the docs example or will there be some variation of the use/base statements?
  • Are there tips for writing reusable C::As that could help prevent the novice from taking the scenic route?
  • Not having a foundation in OOP can be a hindrance when trying to tackle C::A. I find myself trying to figure out which tasks should be run mode vs. non-run mode subroutines.
  • What is the best way to handle the location of template files (when using multiple C::As)?
  • A little more explanation about your print function would be nice. Some people may not understand the %params to @params trick. Could you explain how the print function works regarding the standard "return $output;" and add a few statements assuming HTML::Template. Just so it is functional (provided the named template exists).

That's all I can think of right now.

--Jim

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2014-12-27 01:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls