CASCM-Wrapper
view release on metacpan or search on metacpan
lib/CASCM/Wrapper.pm view on Meta::CPAN
my $context = {};
foreach ( keys %{$config} ) {
if ( $_ eq '_' ) { $context->{global} = $config->{$_}; }
else { $context->{$_} = $config->{$_}; }
} ## end foreach ( keys %{$config} )
return $self->set_context($context);
} ## end sub load_context
# Update Context
sub update_context {
my $self = shift;
my $new = shift || {};
if ( ref $new ne 'HASH' ) {
$self->_err("Context must be a hash reference");
return;
} ## end if ( ref $new ne 'HASH')
my $context = $self->get_context();
foreach my $type ( keys %{$new} ) {
foreach my $key ( keys %{ $new->{$type} } ) {
$context->{$type}->{$key} = $new->{$type}->{$key};
}
} ## end foreach my $type ( keys %{$new...})
return $self->set_context($context);
} ## end sub update_context
# Parse logs
sub parse_logs {
my $self = shift;
if (@_) {
$self->{_options}->{parse_logs} = shift;
if ( $self->{_options}->{parse_logs} ) {
eval {
require Log::Any;
return 1;
( run in 0.544 second using v1.01-cache-2.11-cpan-4d4bc49f3ae )