The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Bio::Polloc::Polloc::Config - Handles .cfg files

AUTHOR - Luis M. Rodriguez-R

Email lmrodriguezr at gmail dot com

DESCRIPTION

See the scripts folder (.bme files) for examples of the expected syntaxis.

GLOBALS

Global variables controling the behavior of the package

CFGMAXDEPTH

Maximum depth of variables replacement

CFGCURDEPTH

Current depth of replacement (internal var)

APPENDIX

Methods provided by the package

new

  • Initialization method.

  • Arguments

    -spaces arr of str

    A reference to an array of strings, each containing a namespace to be parsed.

    -noparse bool (int)

    If set to true, does not automatically parse the file on creation. If so, the parse function must be manually called.

parse

spaces

  • Gets/sets the spaces to be parsed.

value

  • Gets the value of a given key.

  • Arguments

    -key str

    The key (can contain namespace).

    -space str

    The namespace.

    -mandatory bool (int)

    If true, dies if not found.

    -noalert bool (int)

    If true, does not alert if not found.

  • Throws

    Bio::Polloc::Polloc::Error If not found and mandatory.

all_keys

  • Gets all the stored keys.

  • Arguments

    -space str

    The parent space. By default ..

  • Returns

    All the keys within the space (array of str).

alias

  • A key by alias.

  • Arguments

    -from str

    The from key name.

    -to str

    The to key name.

  • Throws

    Bio::Polloc::Polloc::Error if any of the two keys is empty.

INTERNAL METHODS

Methods intended to be used only within the scope of Bio::Polloc::*

_filter_line

  • Removes comments from lines and lines with spaces only.

_save

  • Saves a key/value pair.

  • Arguments

    -space str

    The namespace

    -key str

    The name of the key (can contain the namespace before a dot (.) if not explicitly provided).

    -value str

    The value.

  • Returns

    The (uniform) key of the saved pair. If array or list, the key and the value.

_parse_space

  • Parses (cleans) the name of a namespace.

  • Arguments

    The namespace to parse.

  • Returns

    The parsed (uniform) namespace.

_space_required

  • Indicates whether a namespace is required. I.e., if the user explicitly requiested the space, any child or any parent.

  • Arguments

    The namespace.

  • Returns

    Boolean (int).

_execute_token

  • Executes a token expected to map to a function.

  • Arguments

    -token str

    The token (can contains namespace if not explicitly passed).

    -space str

    The namespace of the token.

    -body str

    A reference to an array containing the arguments to be passed to the function.

_execute_postparse

  • Executes registered functions to be launched once parsing is finnished.

_register_handle_function

  • Register a handle function (for tokens).

  • Arguments

    -token str

    Token (can contain namespace).

    -obj ref to obj

    Reference to the object *containing* the function.

    -fun str

    Name of the function (note that this is the name of the function within the object, not a reference to the function itself).

    -defaults ref to arr

    Default parameters to be passed to the function after the body.

    -space str

    Namespace of the token.

_register_postparse_function

  • Registers a function to be launched once parsing is complete.

  • Arguments

    -obj ref to obj

    The object containing the function.

    -fun str

    The name of the function within the object.

    -defaults ref to arr

    The parameters to be passed to the function.

_handle_functions

  • Gets the collection of functions to handle tokens.

_postparse_functions

  • Gets the collection of functions to be launched after parsing.

_get_handle_function

  • Gets the handle function for the given token.

  • Arguments

    -token str

    The token.

_reparse

  • Parses recursively all values until no references to other vars last or the maximum depth is reached, whatever happens first.

_parse_key

  • Parses a key and returns its uniform name.

  • Arguments

    -key str

    The key name (can contain namespace if not explicitly set).

    -space str

    The namespace.

_key_alias

  • Creates an alias for a key based on a string input. See alias.

  • Arguments

    A string containing the name of the from key, one or more spaces and the name of the to string. Can contain surrounding spaces.

  • Throws

    Bio::Polloc::Polloc::Error if empty string or not properly formatted.

_initialize

21 POD Errors

The following errors were encountered while parsing the POD:

Around line 62:

Expected '=item *'

Around line 97:

Expected '=item *'

Around line 174:

Expected '=item *'

Around line 196:

Expected '=item *'

Around line 230:

Expected '=item *'

Around line 240:

Expected '=item *'

Around line 264:

Expected '=item *'

Around line 278:

Expected '=item *'

Around line 339:

Expected '=item *'

Around line 358:

Expected '=item *'

Around line 404:

Expected '=item *'

Around line 408:

Expected '=item *'

Around line 434:

Expected '=item *'

Around line 438:

Expected '=item *'

Around line 473:

Expected '=item *'

Around line 559:

Expected '=item *'

Around line 610:

Expected '=item *'

Around line 684:

Expected '=item *'

Around line 750:

Expected '=item *'

Around line 792:

Expected '=item *'

Around line 797:

Expected '=item *'