This software provides a Perl interface to modulecmd, allowing users to easily access modulecmd functionalities from within Perl scripts.
Env::Modulecmd employs a system call to 'modulecmd perl [cmd] [module]' to interface with modulecmd, assuming modulecmd is in the PATH. If PERL_MODULECMD is specified, Env::Modulecmd uses that instead of modulecmd. In the event that modulecmd is not found, an error is returned, and the script dies.
When installed, Env::Modulecmd can include a default path to modulecmd and default MODULEPATH settings. This information is covered in greater detail in the source tree's README file.
Aside from loading and unloading modules, modulecmd can produce warnings and informational messages; standard error handles these messages. Env::Modulecmd examines the output provided by standard error to detect fatal errors. If the output begins with "ERROR:" or matches modulecmd's conventional error message format, Env::Modulecmd fails. In cases where Perl warnings are enabled (-w, or use warnings), Env::Modulecmd emits warnings associated with these outputs.
If there are no fatal errors, the output produced by modulecmd is eval'ed. If this operation fails, Env::Modulecmd will fail. Finally, if you attempt to load a module that has already been loaded, or perform any other benign operation, modulecmd will produce no output or error, and Env::Modulecmd will silently ignore it.
The SYNOPSIS provided offers a clear example of how Env::Modulecmd can be used in various contexts, including implicit and explicit operations.
Version 1.2b: N/A