Software Build, CI and Test Automation
16 Oct
Perl offers various ways to share/reuse code. When enhancing perl code/modules used in multiple applications and/or parallel releases, it is important to ensure that we get an early warning if the change made is not backward compatible and if there is a potential for the existing applications to break. With “use” we would know if a reference is made to an unavailable module at compile time itself. However, there are cases, when we need to be backward compatible and allow the existing applications that share code to function seamlessly. Using “require” instead of “use” has come in handy to ensure that the existing applications continue to work and at the same time allow the new releases to use the new functionality. This is because “require” is more dynamic and loads the modules at run time when needed and not at compile time unlike “use”.
Leave a reply