```{index} single: YAML::PP::Constructor ``` # YAML::PP::Constructor Constructing data structure from parsing events ## METHODS - new The Constructor constructor ```perl my $constructor = YAML::PP::Constructor->new( schema => $schema, cyclic_refs => $cyclic_refs, ); ``` - init Resets any data being used during construction. ```perl $constructor->init; ``` - document\_start\_event, document\_end\_event, mapping\_start\_event, mapping\_end\_event, sequence\_start\_event, sequence\_end\_event, scalar\_event, alias\_event, stream\_start\_event, stream\_end\_event These methods are called from [YAML::PP::Parser](https://metacpan.org/pod/YAML::PP::Parser): ```perl $constructor->document_start_event($event); ``` - anchors, set\_anchors Helper for storing anchors during construction - docs, set\_docs Helper for storing resulting documents during construction - stack, set\_stack Helper for storing data during construction - cyclic\_refs, set\_cyclic\_refs Option for controlling the behaviour when finding circular references - schema, set\_schema Holds a [YAML::PP::Schema](Schema.md) object - stringify\_complex When constructing a hash and getting a non-scalar key, this method is used to stringify the key. It uses a terse Data::Dumper output. Other modules, like [YAML::XS](../XS.md), use the default stringification, `ARRAY(0x55617c0c7398)` for example.