Fairchild has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I'm in the process of setting up a SVN repository to host alot of perl programs as I am trying to improve my development environment (eclipse and perl afterwards). This is the first time that I have used subversion so I am wondering if there is any suggestions to how the directory should be laid out.

For example, my standard format for a perl program is to have a bin directory where the main perl program is hosted, I would then have a lib directory for any developed perl packages, followed by a docs directory, etc. I don't know if this makes sense from a subversion point of view, so I am looking for some guidelines.

I have looked over the net but haven't found anything very specific. As a last resort I though I would ask here as it's kind of a perl question. However if there is a guide or if there is a better forum please let me know. Thanks.

Fairchild.

Replies are listed 'Best First'.
Re: Subversion layout for perl
by moritz (Cardinal) on Jan 25, 2010 at 13:28 UTC
    There are two things to consider:

    The directory layout for SVN usually looks like this:

    /trunk/ # <- development usually happens here /branches/ # <- for storing branches /tags/ # <- for storing tags
    Inside the /trunk/ directory you usually put the layout for a module. There's a standard layout that most CPAN modules use. It looks along these lines (where most are optional):
    lib/ # .pm files t/ # unit tests bin/ # scripts extras/ # whatever.. examples/ doc/

    Take a look at Module::Starter which might be helpful for you.

    Perl 6 - links to (nearly) everything that is Perl 6.
Re: Subversion layout for perl
by bellaire (Hermit) on Jan 25, 2010 at 13:26 UTC

    Subversion doesn't particularly care about your directory layout, there's no reason you have to change from what you have now.

    To elaborate, it's typical to have separate projects at the top level of the repository each in a directory, and beneath this you have directories for different parts of your release cycle, for example /trunk, /branches, /tags. Beneath that, for example in /trunk, you have your project set up exactly the way it's always been set up.

    So really this isn't a Perl question: How to set up your directories at the top level down to, for example, /trunk, is a subversion question and there are materials elsewhere that explain that. Beneath this, your directories are whatever you find useful for your project, and this is a Perl concern that has nothing to do with subversion.

    If your Perl programs are interdependent in terms of their locations on disk, that complicates matters, but I'm not clear if that's part of your question or not, and anyway that would be a more general Perl question that's not specific to subversion.