The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

App::CELL::Config -- load, store, and dispense meta parameters, core parameters, and site parameters

VERSION

Version 0.146

SYNOPSIS

    use App::CELL::Config qw( $meta $core $site );

    # get a parameter value (returns value or undef)
    my $value;
    $value = $meta->MY_PARAM;
    $value = $core->MY_PARAM;
    $value = $site->MY_PARAM;

    # set a meta parameter
    $meta->set( 'MY_PARAM', 42 );

    # set an as-yet undefined core/site parameter
    $core->set( 'MY_PARAM', 42 );
    $site->set( 'MY_PARAM', 42 );

DESCRIPTION

The purpose of the App::CELL::Config module is to maintain and provide access to three package variables, $meta, $core, and $site, which are actually singleton objects, containing configuration parameters loaded by App::CELL::Load from files in the distro sharedir and the site configuration directory, if any.

For details, read App::CELL::Guilde.

EXPORTS

This module exports three scalars: the 'singleton' objects $meta, $core, and $site.

AUTOLOAD ROUTINE

The AUTOLOAD routine handles calls that look like this: $meta->MY_PARAM $core->MY_PARAM $site->MY_PARAM

set_meta

By definition, meta parameters are mutable. Use this function to set or change them. Takes two arguments: parameter name and new value. If the parameter didn't exist before, it will be created. Returns 'ok' status object.

TO_DO: check value to make sure it's a scalar.

set_core

Sets core parameter, provided it doesn't already exist. Wrapper.

set_site

Sets site parameter, provided it doesn't already exist. Wrapper.

_set_core_site

Core and site parameters are immutable. This function can be used to set them, provided they don't already exist. Takes three arguments: param type, param name and new value. If the parameter didn't exist before, it will be created. Returns 'ok' status object on success, or error object on failure.