Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: How do you organize your Perl applications?

by simon.proctor (Vicar)
on Apr 04, 2003 at 23:37 UTC ( [id://248217]=note: print w/replies, xml ) Need Help??


in reply to How do you organize your Perl applications?

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.

HTH

SP

Replies are listed 'Best First'.
Re: Re: How do you organize your Perl applications?
by DapperDan (Pilgrim) on Apr 05, 2003 at 08:37 UTC
    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';

    Ahhh! A phrasebook for templates? That's a great idea.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://248217]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-25 17:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found