Config::Model::Role::ComputeFunction - compute &index or &element functions
version 2.113
$value->eval_function('index'); $value->eval_function('element'); $value->eval_function('index','-'); $value->eval_function('index','- -'); $value->eval_function('index','-3'); $value->compute_string('&element(-)') $value->compute_string('&index(- -)');
Role used to let a value object get the index or the element name of $self or of a node above.
$self
Retrieve the index or the element name. Parameters are
( function_name , [ up ])
element or index
element
index
Optional parameter to indicate how many level to go up before retrieving the index or element name. Each - is equivalent to a call to parent|Config::Model::Node/parent. Can be repeated dashes ("-", "- -", ...) or a dash with a multiplier ("-", "-2", ...). White spaces are ignored.
-
parent|Config::Model::Node/parent
- -
-2
Perform a similar function as eval_function using a string where function names are extracted.
eval_function
E.g. compute_string('&element(-)') calls eval_function('element','-')
compute_string('&element(-)')
eval_function('element','-')
Dominique Dumont
This software is Copyright (c) 2005-2017 by Dominique Dumont.
This is free software, licensed under:
The GNU Lesser General Public License, Version 2.1, February 1999
To install Config::Model, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Config::Model
CPAN shell
perl -MCPAN -e shell install Config::Model
For more information on module installation, please visit the detailed CPAN module installation guide.