Daniel Browning > Business-Shipping > Business::Shipping::Config

Download:
Business-Shipping-2.03.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  2
View Bugs
Report a bug
Module Version: 257   Source  

NAME ^

Business::Shipping::Config - Configuration functions

VERSION ^

$Rev: 257 $

DESCRIPTION ^

Among other things, this module implements a simple API on top of the Config::IniFiles module.

METHODS ^

cfg()

Returns config hashref.

cfg_obj()

Returns config hashref.

support_files()

Returns the path of the support_files directory.

config_to_hash( $ary, $del )

 $ary   Key/value pairs
 $del   Delimiter for the above array (tab is default)

Builds a hash from an array of lines containing key / value pairs, like so:

 key1    value1
 key2    value2
 key3    value3

config_to_ary_of_hashes( 'configuration_parameter' )

Reads in the configuration hashref ( e.g. cfg()->{ primary }->{ secondary } ), then returns an array of hashes. For example:

This:

 [invalid_rate_requests]
 invalid_rate_requests_ups=<<EOF
 service=XDM    to_country=Canada    reason=Not available.
 service=XDM    to_country=Brazil
 EOF

When called with this:

 my @invalid_rate_requests_ups = config_to_ary_of_hashes( 
     cfg()->{ invalid_rate_requests }->{ invalid_rate_requests_ups }
 );

Returns this:

 [ 
     {
         to_country => 'Canada',
         service    => 'XDM'
     },
     {
         to_country => 'Brazil',
         service    => 'XDM'
     },
 ]

data_dir_name()

The name of the data_dir (e.g. "data").

data_dir()

The path of the data_dir (e.g. "/var/perl/Business-Shipping/data").

get_req_mod()

Return a list of the required modules for a given shipper. Return all if no shipper is given.

calc_req_mod()

Determine if the required modules for each shipper are available, in turn.

AUTHOR ^

Dan Browning <db@kavod.com>, Kavod Technologies, http://www.kavod.com.

COPYRIGHT AND LICENCE ^

Copyright (c) 2003-2004 Kavod Technologies, Dan Browning. All rights reserved. This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. See LICENSE for more info.