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

NAME

Finance::GeniusTrader::Conf - Manage configuration

DESCRIPTION

This module provides functions to manage personal GeniusTrader configuration. The configuration information are stored in file ~/.gt/options by default.

The configuration file format is similar to a perl hash, in other words, a key followed by data for that key. keys are delimited from their value by whitespace. key values can contain embedded whitespace.

key value strings can be continued across multiple lines by delimiting the newline with a backslash (\) (watch out for trailing whitespace after the \ and before the newline).

comments introduced with a # as the first character on a line. data lines cannot contain a comment since the # character is used in many data strings.

blank lines and lines with only whitespace are ignored.

EXAMPLES of ~/.gt/options Entries

# this is an example of a comment

DB::module genericdbi

DB::bean::dbname beancounter

Graphic::Candle::UpBorderColor "[0,180,80]"

Graphic::Candle::DownBorderColor "[180,0,80]"

this example shows how continuing key values across lines can be useful.

DB::genericdbi::prices_sql SELECT day_open, day_high, day_low, \ day_close, volume, date FROM stockprices WHERE symbol = '$code' ORDER \ BY date DESC

the following shows why comments are not permitted on data lines:

Aliases::Global::TFS2[] SY:TFS #1 #2 | CS:SY:TFS #1

FUNCTIONS

Finance::GeniusTrader::Conf::load([ $file ])

Load the configuration from the indicated file. If the file is omitted then it looks at ~/.gt/options by default.

Finance::GeniusTrader::Conf::clear()

Clear all the configuration.

Finance::GeniusTrader::Conf::store($file)

Write all the current configuration in the given file. Note: all prior commentary, if any is lost.

Finance::GeniusTrader::Conf::get($key,$defaultValue)

Return the configuration value for the given key. If the key doesn't exist, it returns the optional defaultValue.

If neither the key nor defaultValue exist, it returns undef.

Finance::GeniusTrader::Conf::set($key, $value)

Set the given configuration item to the corresponding value. Replaces any previous value.

Finance::GeniusTrader::Conf::default($key, $value)

Set a default value to the given item. Must be called by GT itself to give reasonable default values to most of configurations items.

Finance::GeniusTrader::Conf::get_first($key, ...)

Return the value of the first item that does have a non-zero value.

Finance::GeniusTrader::Conf::=_get_home_path()

Helper function, returns the home directory environment variable HOME on Unix or on windows the environment variables HOMEDRIVE . HOMEPATH

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 60:

You forgot a '=back' before '=head1'

Around line 62:

'=item' outside of any '=over'