"#!/usr/bin/env perl" and using multiple environments

Bradley Dean bjdean at unimelb.edu.au
Sat May 24 18:05:00 CDT 2003


Greetings folks,

I've been considering the potential benefits of using some sort of
self-rolled /usr/bin/env in project development when multiple environments
are needed.

For instance - if a projects development, testing and production
environments use entirely separate module libraries, it would be nice not
to have to hard code the appropriate 'use lib's.

Now env soes have the ability to let you change specific environment
variables, but if their are lots of changes that's going to lead to a messy
#! at the start of each script.

The alternative I'm considering is to have something like:
 - env-dev
 - env-test
 - env-prod

Which essentially do the same thing as env, but with a (dev|test|prod)
environment built.

This way the #!'s become '#!/somepath/env-dev perl' for instance and al;
should notionally be well (and there should be no need for any hard coding
of specific 'modes' within the code itself)

It also means that a general environment can be built up so the
env-(dev|test|prod) can be used to construct all environments, not just the
perl #!'s

Anyone seen this sort of thing done, have any thoughts on the matter?

Brad

-- 
Melbourne University ITSAD SDI - Campus Wide Info Systems Group (CWIS)
Email: bjdean at unimelb.edu.au Phone: +61-3-83443997 Mobile: +61-413014395

Australian Intervarsity Choral Societies Association - Secretary
Email: secretary at aicsa.org.au   Web: http://www.aicsa.org.au



More information about the Melbourne-pm mailing list