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/
)
The scripts must be all under the same base directory but they may be in its sub-directories at arbitrary depth level (this precludes the classic use lib "$FindBin::Bin/../lib"
solution from section 31.13. use lib of "Programming Perl")
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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…