App::Env::Example

App::Env::Example is an example application environment module for App::Env.
Download

App::Env::Example Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Diab Jerius
  • Publisher web site:
  • http://search.cpan.org/~djerius/

App::Env::Example Tags


App::Env::Example Description

App::Env::Example is an example application environment module for App::Env. App::Env::Example is an example application environment module for App::Env.Modules used by App::Env to load application environments are named App::Env::or, if there is a site specific version: App::Env::::It is very important that the loaded environment be based upon the current environment. For example, if the environment is derived from running a shell script, make sure either that the shell script is run without running the user's startup file, or that any differences between the current environment and that constructed by the script which are not due to the application are resolved in the current environment's favor. For example, say that LD_LIBRARY_PATH is set in the user's .cshrc file: setenv LD_LIBRARY_PATH /my/path1and that before invoking App::Env the user has modified it to /my/path1:/my/path2If a csh script is sourced to create the environment, and csh is not run with the -f flag, the user's .cshrc will be sourced, the user's modifications to LD_LIBRARY_PATH will be lost, and breakage may happen.With that said, it may be necessary in some cases to provide an environment which is independent of the current one. If a module is capable of doing so, it should do so when presented with the Pristine AppOpts option. If it is not capable of doing so the presence of that option should be treated as an error. Pristine environments will by definition cause problems in merged environments.Application AliasesIf application environments should be available under alternate names (primarily for use appexec), a module should be created for each alias with the single class method alias which should return the name of the original application. For example, to make App3 be an alias for App1 create the following App3.pm module: package App::Env::App3; sub alias { return 'App1' }; 1;The aliased environment can provide presets for AppOpts by returning a hash as well as the application name: package App::Env::ciao34; sub alias { return 'CIAO', { Version => 3.4 } }; 1;These will be merged with any AppOpts passed in via import(), with the latter taking precedence.FunctionsThey should define the following functions:envs $hashref = envs( %opts ); $hashref is a hash containing environmental variables and their values. %opts will contain the options passed to App::Env::import via the AppOpts option.See the source of this module for a simple example. Requirements: · Perl


App::Env::Example Related Software