
Config::Constants::XML - Configuration loader for Config::Constants

use Config::Constants::XML;

This module reads and parses XML files as configuration files that look like this:
<config>
<module name='Foo::Bar'>
<constant name='BAZ' value='the coolest module ever' />
</module>
</config>
It is also possible to do more complex constant value types, like this:
<config>
<module name='Foo::Bar2'>
<constant name='BAZ' type='ARRAY'>
[ 1, 2, 3 ]
</constant>
</module>
<module name='Bar::Baz2'>
<constant name='FOO' type='HASH'>
{ test => 'this', out => 10 }
</constant>
<constant name='BAR' type='My::Object'>
My::Object->new()
</constant>
</module>
</config>
The type parameter much match the value returned after eval-ing the text.
You can also include other configurations into the current one like this:
<config>
<include path='conf/base_conf.xml' />
<module name='Foo::Bar'>
<constant name='BAZ' value='the coolest module ever' />
</module>
</config>
The configurations are processed in order, so in this example, anything set in conf/base_conf.xml will be shadowed by anything set in the current xml.

This takes the file, loads, parses and stores the resulting configuration.
This will return an array of modules in this configuration.
Given a $module_name, this will return an array of hash references for each constant specified.


None that I am aware of. Of course, if you find a bug, let me know, and I will be sure to fix it.

I use Devel::Cover to test the code coverage of my tests, see the Config::Constants module for more information.


stevan little, <stevan@iinteractive.com>

Copyright 2005 by Infinity Interactive, Inc.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.