Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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.


Log In?

What's my password?
Create A New User
[LanX]: ah... Denmark is planning to build a wall at the German border!
[LanX]: # Pestis Africana Suum
[erix]: that's an old plan, I think. Isn't there already a danewal (or some such name)?
[marto]: Build with -Wall
[erix]: Danewerk
[LanX]: I seem to remember that the danewall was build by the Frankish empire against the Danes
[erix]: 500 AD thru viking age
[erix]: that would make sense but wikipedia thinks otherwise
[LanX]: oh me was wrong ...
[erix]: but it always works both ways of course

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (11)
As of 2018-03-22 18:38 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (283 votes). Check out past polls.