If that is your situation, then one solution is that you can create some form of Local::Config module whose purpose is to look at some combination of user, environment variables, configuration files, command line arguments or whatever else you choose to decide what version of the code to run. Then it should adjust @INC to fit that, and can also set key variables. For instance you likely will want development code to connect to a different database instance than production code - that can be set up here. This module should be kept as small and simple as possible because updating it is a real PITA. (I'd suggest having the configuration module figure out what version you are running, and then load the real configuration module of that version. That module now can set all environment variables that you need, special configuration information etc. This makes developing and rolling out a new configuration variable much easier - the global module never gets touched. Only the one that it loads.)
If your needs are simple, you can just specify some environment variables that make the switch, and create some shell aliases to make it easy for you to switch between them. However once you have 3-4 variables to keep on flipping together, having the configuration module is a lifesaver.
In reply to Re: Supporting a production environment
by tilly
in thread Supporting a production environment
by jeb6kids
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |