Daniele Ricci > Config-General-Hierarchical-0.07 > Config::General::Hierarchical::Dump

Download:
Config-General-Hierarchical-0.07.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.07   Source  

NAME ^

Config::General::Hierarchical::Dump - Hierarchical Generic Config Dumper Module

SYNOPSIS ^

Simple use:

 $
 $ cat example.conf
 #!/usr/local/bin/perl -MConfig::General::Hierarchical::Dump
 variable1 value
 variable2
 <node>
  key value
 </node>
 $
 $ chmod 755 example.conf
 $ ./example.conf
 node->key = 'value'
 variable1 = 'value'
 variable2 = ''
 $
 $

Full use:

 package MyConfig::Dump;
 #
 use base 'Config::General::Hierarchical::Dump';
 use MyConfig;
 #
 sub parser {
  return 'MyConfig';
 }

DESCRIPTION ^

This module provides an easy way to dump configuration files written for Config::General::Hierarchical.

SUBROUTINES/METHODS ^

import

Implicitally called by -M perl option, it reads the configuration file itself, dumps it to standard output and exits.

parser

Returns the class name to be used to parse the file, by default Config::General::Hierarchical. If you exetend Config::General::Hierarchical with so many customization that you need to use your own class to parse the file, you can extend Config::General::Hierarchical::Dump as well and simply redefine this method to return your own class name and use this second new class as parameter of -M perl option.

CMD LINE PARAMETERS ^

-c, --check

This can beusefull to find immediatelly which are eventaul configuration variables not respecting the syntax constraint

-f, --file

Makes the source file (foreach variable) to be printed.

-l, --fixed-length

Formats the output as fixed characters length.

-h, --help

Prints an help screen and exits.

-j, --json

Prints the output as a json string.

BUGS AND INCOMPATIBILITIES ^

Please report.

LICENSE AND COPYRIGHT ^

Copyright (c) 2007-2009 Daniele Ricci

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR ^

Daniele Ricci <icc |AT| cpan.org>

VERSION ^

0.07

syntax highlighting: