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


Config-General-Hierarchical documentation  | view source Contained in the Config-General-Hierarchical distribution.

Index


NAME

Top

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

SYNOPSIS

Top

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

Top

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

SUBROUTINES/METHODS

Top

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

Top

-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

Top

Please report.

LICENSE AND COPYRIGHT

Top

AUTHOR

Top

Daniele Ricci <icc |AT| cpan.org>

VERSION

Top

0.06


Config-General-Hierarchical documentation  | view source Contained in the Config-General-Hierarchical distribution.