How do I use test/beta Perl modules from test Perl scripts?
- by DVK
If my Perl code has a production code location and "beta" code location
(e.g. production Perl code us in /usr/code/scripts, BETA Perl code is in /usr/code/beta/scripts; production Perl libraries are in /usr/code/lib/perl and BETA versions of those libraries are in /usr/code/beta/lib/perl, is there an easy way for me to achieve such a setup?
The exact requirements are:
The code must be THE SAME in production and BETA location.
To clarify, to promote any code (library or script) from BETA to production, the ONLY thing which needs to happen is literally issuing cp command from BETA to prod location - both the file name AND file contents must remain identical.
BETA versions of scripts must call other BETA scripts and BETA libraries (if exist) or production libraries (if BETA libraries do not exist)
The code paths must be the same between BETA and production with the exception of base directory (/usr/code/ vs /usr/code/beta/)
I will present how we solved the problem as an answer to this question, but I'd like to know if there's a better way.