NAME

Business::Shipping::Config - Configuration-related routines

VERSION

$Revision: 1.3 $ $Date: 2004/02/08 00:42:24 $

DESCRIPTION

Business::Shipping::Config is currently just a simple API on top of the Config::IniFiles module.

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 = $self->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'
    },
]

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. Licensed under the GNU Public Licnese (GPL). See COPYING for more info.