CAD::Firemen::Load - Module to parse files from Firemen (like pro and cdb files)
version 0.7.2
Loads the given config file and returns an array as described below. As parameter it expacts the URL to the config file which should be loaded.
$results = { "OPTION_ONE" => { "1" => "VALUE_OF_OPTION_ONE_IN_LINE_1", "2" => "VALUE_OF_OPTION_ONE_IN_LINE_2" }, "OPTION_TWO" => { "12" => "VALUE_OF_OPTION_TWO_IN_LINE_12" } };
$errors = { "1" => "Error description for line 1", "12" => "Error description for line 12" }; return ($results, $errors, PARSED_LINES);
The function loads a CDB file and returns the result as a hash like shown below.
Expacts the URL to the cdb file which should be loaded as first parameter.
Result:
# since in cdb, the option should be present ones, the line number # is only mentioned to be compatible to the output format of # loadConfig() $results = { "OPTION_ONE" => { 1 => { "YES" => 0, "NO" => 1 } }, "OPTION_WITHOUT_DEFAULT_VALUE" => { 2 => { "VALUE1" => 0, "VALUE2" => 0, "VALUE3" => 0 } } }; $errors = { "1" => "Error description for line 1", "12" => "Error description for line 12" }; return ($results, $errors)
Loads the options from given database and returns the same structure as descriped at loadCDB(). But it adds a third hash reference to the return vector, which contains descriptions (values) for the options (keys).
It needs the database handle as first parameter and the SQL query string, which should be used to find options as second parameter.
Returns an array with possible values for the actual option. Requires a valied file handler as first parameter.
Joachim Langenbach <langenbach@imw.tu-clausthal.de>
This software is Copyright (c) 2015 by TU Clausthal, Institut fuer Maschinenwesen.
This is free software, licensed under:
The GNU General Public License, Version 2, June 1991
To install CAD::Firemen, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CAD::Firemen
CPAN shell
perl -MCPAN -e shell install CAD::Firemen
For more information on module installation, please visit the detailed CPAN module installation guide.