Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I'm not sure if I'm missing something or not, but I don't see the point behind CGI::Application. I've read the tutorial at perl.com, and I still find the point eluding me.

It seems like some of the biggest points are:

1) Code Reusability.
- Solved by making your code better in the first place, more modular.

2) Most CGI applications are big if/else blocks.
- Solved by the above as well. And isn't using C::A Just kinda like moving all of your if/else blocks into one spot, while adding yet another layer of abstraction to get to them?

3) Portability.
- Again, just code better.

What am I missing? Why add what seems like another layer of complexity and confusion, for no real benefit (no offense inteded to the author).

It seems as though all of the benefits of C::A are things that can be accomplished by simply adjusting your coding style; making more blocks of code into subroutines, etc. You'll still have the big block of C::A setup stuff at the top of your script; why not have an if/else that calls different subroutines.

-Scott

In reply to Why CGI::Application? by sdbarker

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2024-04-20 13:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found