App::Env

Manage application specific environments
Download

App::Env Ranking & Summary

Advertisement

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

App::Env Tags


App::Env Description

App::Env is a Perl module that presents a uniform interface to initializing environments for applications which require special environments. App::Env only handles the loading, merging, and caching of environments; it does not create them. That is done within modules for each application suite (e.g. App::Env::MyApp). App::Env ships with two such modules, App::Env::Null which simply returns a snapshot of the current environment, and App::Env::Example, which provides example code for creating an application specific environment.App::Env is probably most useful in situations where a Perl program must invoke multiple applications each of which may require an environment different and possibly incompatible from the others. The simplified interface it provides makes it useful even in less complicated situations.SYNOPSIS # import environment from application1 then application2 into current # environment use App::Env ( $application1, $application2, \%opts ); # import an environment at your leisure use App::Env; App::Env::import( $application, \%opts ); # set defaults use App::Env ( \faults ) App::Env::config( faults ); # retrieve an environment but don't import it $env = App::Env->new( $application, \%opts ); # execute a command in that environment; just as a convenience $env->system( $command ); # exec a command in that environment; just as a convenience $env->exec( $command ); # oh bother, just import the environment $env->import; # cache this environment as the default for $application $env->cache( 1 ); # uncache this environment if it is the default for $application $env->cache( 0 ); # generate a string compatible with the *NIX env command $envstr = $env->str( \%opts ); # or, stringify it for (mostly) the same result system( 'env -i $env command' ); # pretend it's a hash; read only, though %ENV = %$env;Product's homepage


App::Env Related Software