Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
All of the modules are put under a tree like MyCompany, mainly to keep them as a unit (i.e. in case I ever want to install third-party modules under the same tree). If there are modules that are specific to an application or a specific resource, I put those modules under a subtree of MyCompany. Nothing original here.

I generally install in a directory outside of perl's tree. This allows me to update my code or perl at different times. Also, if I have more than one perl installed (i.e. not just different versions in the same tree), I don't have to install my modules under each perl's tree. There's probably a clever way of configuring perl to do this when you build it, but I haven't looked into this.

To access modules from a script I do something like...

use FindBin qw($RealBin); use lib ("$RealBin/../lib/perl", "/my/well/known/lib/path"); use MyCompany::MyModule;

The first 'use lib' path is for testing purposes (e.g. just before an install, or on a test machine). The second is the production path and is a full path so that the script can be moved and still work properly.

This works reasonably well. If you can live with the script not being moved around, I'd suggest not using a full path since it limits changes to the environment. Also, if it weren't too much coding I'd like to be able to turn off the test path during production -- I just haven't thought of a clean/easy way of doing this. I work in a limited environment so that this is not much of a security issue though.


In reply to Re: How to lay out private modules? by bluto
in thread How to lay out private modules? by Tanktalus

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 sharing their wisdom with the Monastery: (6)
As of 2024-04-23 19:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found