App-Env

 view release on metacpan or  search on metacpan

README.mkdn  view on Meta::CPAN

    - SysFatal _boolean_

        If true, the **system**, **qexec**, and **capture** object methods will throw
        an exception if the passed command exits with a non-zero error.

    - Temp _boolean_

        If true, and the requested environment does not exist in the cache,
        create it but do not cache it (this overrides the **Cache** option).
        If the requested environment does exist in the cache, return an
        non-cached clone of it.  The following options are updated in
        the cloned environment:

            SysFatal

- retrieve

        $env = App::Env::retrieve( $cacheid );

    Retrieve the environment with the given cache id, or undefined if it
    doesn't exist.

lib/App/Env.pm  view on Meta::CPAN

=item SysFatal I<boolean>

If true, the B<system>, B<qexec>, and B<capture> object methods will throw
an exception if the passed command exits with a non-zero error.

=item Temp I<boolean>

If true, and the requested environment does not exist in the cache,
create it but do not cache it (this overrides the B<Cache> option).
If the requested environment does exist in the cache, return an
non-cached clone of it.  The following options are updated in
the cloned environment:

  SysFatal

=back

=item retrieve

  $env = App::Env::retrieve( $cacheid );

t/clone.t  view on Meta::CPAN

    # now clone it
    my $clone = $app1->clone;

    ok( defined $clone, 'cloned env' );

    is( $clone->env( 'AppEnvTestID' ), $$, 'check cloned env' );

    # change cloned environment
    $clone->setenv( 'CloneTest' => 1 );

    is( $clone->env( 'CloneTest' ), 1, 'check updated cloned env' );

    # and ensure that the parent environment has not been changed

    is( $app1->env( 'CloneTest' ), undef, 'check parent env' );

    # and ensure that the clone has a new object id
    isnt( $app1->lobject_id, $clone->lobject_id, 'clone object id' );

}



( run in 0.329 second using v1.01-cache-2.11-cpan-05444aca049 )