NAME

BATsh::Env - Shared variable store for BATsh

SYNOPSIS

use BATsh::Env;

BATsh::Env::init();           # seed from %ENV
BATsh::Env::set('FOO', 'bar');
my $v = BATsh::Env::get('FOO');
BATsh::Env::setlocal();       # snapshot (SETLOCAL)
BATsh::Env::endlocal();       # restore  (ENDLOCAL)
BATsh::Env::sync_to_env();    # export to %ENV for child processes

DESCRIPTION

BATsh::Env is the single variable table shared by BATsh::CMD and BATsh::SH. Variables set via SET in CMD mode and via export in SH mode both read and write the same %STORE hash.

setlocal() and endlocal() implement the SETLOCAL / ENDLOCAL scope stack, supporting arbitrary nesting.

AUTHOR

INABA Hitoshi <ina@cpan.org>

LICENSE

Same as Perl itself.