[please stop top-posting]
"Ben Liddicott" <> wrote:
> <> wrote in message
> news:bpf4ip$msc$...
> > So anybody out there have any advice on how to organize a
> > big perl project?
> >
> > Pretty much all I'm looking for is philosophical banter on
> > merits of
> >
> > 1) setting PERLIB
> >
> > 2) setting PERL5LIB
> >
> > 3) perl -Idirs
> >
> > 4) 'use lib "../dir/dir";',
> > followed my 'use module;' (which resides in '../dir/dir/')
This Won't Work unless your program is always started from the same
working directory.
> > 5) something I don't know about
>
> My philosophy is always 5:
>
> If it comes with the distribution, leave it where it is.
> If it belongs with an application, even if it is a file which might
> conceiveably be of use in other applications, put it with the application
> script.
It won't be found unless the application is started from its installed
directory... you need to use FindBin to find where the program file
is, and then use lib with that path.
> On your points:
> 1) Don't set PERLIB except in a shellscript which knows exactly which perl
> script it is going to call, and unsets it afterwards.
....or in your .profile &c to point to a personal perl lib under your
home directory.
Another alternative: for platform-specific programs, you can read a
config file in /etc / read a value out of the Windows registry /
etc. as appropriate to find the right directory.
I would have said that something involving 'use lib' is going to be
right, unless you have a small wrapper shell script (say, generated at
install time) that knows absolute paths to everything. In that case,
the only difference between using PERL5?LIB and -I is that if your
program invokes perl again then PERL5?LIB will be passed but -I won't:
which is appropriate depends on the application.
Ben
--
For the last month, a large number of PSNs in the Arpa[Inter-]net have been
reporting symptoms of congestion ... These reports have been accompanied by an
increasing number of user complaints ... As of June,... the Arpanet contained
47 nodes and 63 links. [
ftp://rtfm.mit.edu/pub/arpaprob.txt] *