Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Here's mine:
docroot logs admin templates config logs Readme.txt lib <---- may be called something else see below
It should be fairly explanatory other than the admin programs for any web application go in the admin folder and have a separate (sub)domain/virtual host. Naturally the docroot folder (document root) is for the web application main. The logs folder is both for any debug or normal running logs as well as any logs from the webserver.

If this isn't a web application, then the docroot goes but the admin folder normally remains (it depends). As for the lib folder. This holds any modules that I write that I don't find on CPAN or need to get from CPAN but cannot install and have to do a 'use lib' for.

One thing I always do is add a --help option to any command line scripts . I always forget how to use my own programs!

In the context of your files, ini goes in the config folder, html in the templates folder (or sub folder), module in the lib folder and as this isn't a web app, the perl script goes in the root. As you would expect, tests go into a 't' folder.

The readme is to describe where everything is and what it does. Possibly not Perl style but some of my command line apps get used by people not used to these things but who can follow instructions.

As an aside, when using templates I tend to create template aliases (see below). This allows me to change where files are in one place without hunting through code.
$templates->{'login screen'} = '/www/templates/login/form.phtml';
I also call all my files with the same endings. So config files end in .config, html templates end in .phtml and so on.



In reply to Re: How do you organize your Perl applications? by simon.proctor
in thread How do you organize your Perl applications? by Wally Hartshorn

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, 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, 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.
  • Log In?

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

    How do I use this? | Other CB clients
    Other Users?
    Others surveying the Monastery: (2)
    As of 2021-04-16 21:18 GMT
    Find Nodes?
      Voting Booth?

      No recent polls found