Math::Formula::Config::INI - load/save formulas to file as INI
Math::Formula::Config::INI is a Math::Formula::Config
my $context = Math::Formula::Content->new(name => 'test'); my $config = Math::Formula::Config::INI->new(directory => $dir); $config->save($context); my $context = $config->load('test');
Save and load a Math::Formula::Context to INI files. The INI file is not too complex.
You need to have installed Config::INI. That module is not in the dependencies of this packages, because we do not want to add complications to the main code.
Extends "DESCRIPTION" in Math::Formula::Config.
Extends "METHODS" in Math::Formula::Config.
Extends "Constructors" in Math::Formula::Config.
Inherited, see "Constructors" in Math::Formula::Config
Extends "Attributes" in Math::Formula::Config.
Inherited, see "Attributes" in Math::Formula::Config
Extends "Actions" in Math::Formula::Config.
Load a Math::Formula::Context for an INI file.
-Option --Default filename <directory/$name.ini>
Serialize the $context to INI files, as storage or to be edited by hand. This is a useful method when default configuration templates need to be generated.
-Option --Default filename $context->name .ini
Save under a different filename than derived from the name of the context.
According to https://en.wikipedia.org/wiki/INI_file, INI files only support strings and numbers. To stay as close as possible to that description, everything else is put between double quotes (also the booleans).
Only the quoted data may contain attributes.
. Example
name = test version = 1 created = "2023-02-26T20:07:54+0000" updated = "2023-02-26T20:07:54+0000" mf_version = 0 [formulas] expr2 = "\"abc\".size + 3k"; returns='MF::INTEGER' fakes = "false" dinertime = "18:05:07" expr1 = "1 + 2 * 3" string = abc some_truth = "true"
This module is part of Math-Formula distribution version 0.16, built on March 14, 2023. Website: http://perl.overmeer.net/CPAN/
Copyrights 2023 by [Mark Overmeer <markov@cpan.org>]. For other contributors see ChangeLog.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://dev.perl.org/licenses/
To install Math::Formula, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Math::Formula
CPAN shell
perl -MCPAN -e shell install Math::Formula
For more information on module installation, please visit the detailed CPAN module installation guide.