mschilli/dns-zoneparse-perl — pull request #1 by xdrr (2014-10-20 00:13:02+00:00)
Title: Added $INCLUDE parsing functionality

Added RFC1035 compliant $INCLUDE parsing functionality to module.

$INCLUDE directives are read and parsed before main record parsing loop to enable the included records to be parsed in the same manner as all other records.

Domain and comment parameters are supported by this new functionality however the latter is not used in the code. The domain parameter sets the relative origin of the records that are included. If excluded the origin of the including zone is used.

The behavior of the $INCLUDE directive is to include the records of the zone file specified at the position of the directive, meaning that if the first record in the included zone has a name it will inherit the name of the last named record, as expected in any zone.

Added new test 'dns-zoneparse-include.t' to test the inclusion of records from another zone but without impacting the primary test. The new test is mostly a clone of dns-zoneparse.t however testing of the parsing of previously parsed and outputted records is not performed as this returns the included records being returned in an order different than when parsed directly from file or variable.

The addition of the test also saw the addition of 2 new zones, 'include-test-zone.db' which contains the $INCLUDE directives and 'included-test-zone.db' which is included by the former zone and has slight alternations in the record name and or values to distinguish the records in the test.