why should I have to declare the login/logout methods in App.pm? My logic told me that defining them in sub setup

Declaring methods in the setup() only says what run-modes/methods can be executed. It does not say where those methods are, since you are putting them into the Account package but you are attempting to use them as a method in the App package the program cannot find them.

By using 'base' you are saying, all the methods that are a part of the Account class, make them a part of the App class as well. So the program runs it will check App class first for a login() method, it cannot find it. It checks the Account class for a login() method, finds and then runs it, all is well! :)

Does this mean that if I create more custom modules to package related functionality together, I would have to do the use base

basically, yes. It is not easy to grasp at first, I know because I struggled with it too. Try it a couple of time and eventually you will get around to figuring it out.


In reply to Re^3: Modularizing CGI::Application by Herkum
in thread Modularizing CGI::Application by punkish

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.