Query: bind::config::parser
OS: debian
Section: 3pm
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
BIND::Config::Parser(3pm) User Contributed Perl Documentation BIND::Config::Parser(3pm)NAMEBIND::Config::Parser - Parse BIND Config file.SYNOPSISuse BIND::Config::Parser; # Create the parser my $parser = new BIND::Config::Parser; my $indent = 0; # Set up callback handlers $parser->set_open_block_handler( sub { print " " x $indent, join( " ", @_ ), " { "; $indent++; } ); $parser->set_close_block_handler( sub { $indent--; print " " x $indent, "}; "; } ); $parser->set_statement_handler( sub { print " " x $indent, join( " ", @_ ), "; "; } ); # Parse the file $parser->parse_file( "named.conf" );DESCRIPTIONBIND::Config::Parser provides a lightweight parser to the configuration file syntax of BIND v8 and v9 using a "Parse::RecDescent" grammar. It is in a similar vein to "BIND::Conf_Parser". However, as it has no knowledge of the directives, it doesn't need to be kept updated as new directives are added, it simply knows how to carve up a BIND configuration file into logical chunks.CONSTRUCTORnew( ); Create a new "BIND::Config::Parser" object.METHODSset_open_block_handler( CODE_REF ); Set the code to be called when a configuration block is opened. At least one argument will be passed; the name of that block, for example "options" or "zone", etc. as well as any additional items up to but not including the opening curly brace. set_close_block_handler( CODE_REF ); Set the code to be called when a configuration block is closed. No arguments are passed. set_statement_handler( CODE_REF ); Set the code to be called on a single line configuration element. At least one argument will be passed; the name of that element, as well as any additional items up to but not including the ending semi-colon. parse_file( FILENAME ); Parse FILENAME, triggering the above defined handlers on the relevant sections.TODOProbably the odd one or two things. I'm fairly sure the grammar is correct.COPYRIGHT AND LICENSECopyright (c) 2005 Matt Dainty. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.AUTHORSMatt Dainty <matt@bodgit-n-scarper.com>.SEE ALSOperl, Parse::RecDescent, BIND::Conf_Parser. perl v5.14.2 2005-06-26 BIND::Config::Parser(3pm)
Related Man Pages |
---|
bind::conf_parser(3) - debian |
tap::parser::multiplexer(3pm) - mojave |
tap::parser::multiplexer(3pm) - suse |
rdf::trinex::parser::rdfa(3pm) - debian |
template::parser(3pm) - debian |
Similar Topics in the Unix Linux Community |
---|
BIND and dig errors |
dnscacheaudit 0.1 (Default branch) |
perl -MConfig -e 'print "$Config{byteorder}\n";' |
Parser |
Rpm for BIND 9 version 9.9.7-P2 (fix CVE-2015-5477) rhel |