View on
Johan Van den Brande > GSM-SMS > GSM::SMS::Config



Annotate this POD


New  4
Open  0
View/Report Bugs
Module Version: 0.161   Source  


GSM::SMS::Config - Implements a simple .ini style config.


Implements a simple configuration format. Used mainly for the transports config file.

The configuration format is defined as follows

  ^#         := comment
  ^[.+]$     := start block
  ^.+=.+$    := var, value pair

The structure allows attribute (configuration) access as follows

  $blockname = ( 'default', <blocknames> }


new - The constructor
  my $cfg = GSM::SMS::Config->new(
               -file => $config_file, # Optional otherwise take default config
                           -check => 1            # Optional, does a sanity check
setup - run the setup script
save_default - save this configuration as the default
read_config - read a configuration file
is_sane - check if a configuration complies with some rules
get_section_names - Get an array of all the section names
get_config - get a specific config file section
  $config->get_config( 'default' );
  $config->get_config( 'Serial01' );
get_value - get the config value for that section
  $value = $config->get_value($section, $name);
generate_config - Generate a boilerplate config file
  perl -MGSM::SMS::Config -egenerate_config

This method prints out a boilerplate config file starting from the settings in the default configuration.

Use this as a starting point to generate the configuration files for the examples.

_config_wizard - The actual question asking mind boggling configurator

This method implements a console based configuration script for the package. It will generate a site-wide config file that will be the default when instantiating a GSM::SMS::NBS class.

_config_transport_serial - Gather config parameters for the serial transport
_config_transport_novelsoft - Gather NovelSoft config info
_config_transport_mcube - Gather MCube specific config params
_config_transport_file - Configure the file transport
_create_directory - Creates a directory

This method will ask you if you want to create a directory, and creates it.


Johan Van den Brande <>

syntax highlighting: