Kent Fredric

NAME

Pod::Eventual::Reconstruct::LazyCut - A Subclass of Pod::Eventual::Reconstruct that emits less =cut's

VERSION

version 0.1.2

SYNOPSIS

If you're blindly filtering POD in an Eventual manner, sometimes removing elements may change the semantics.

For instance, in

    codehere

    =begin foo

    =end foo

    =cut

    codehere

That =cut is an "End of POD Marker".

However, if you simply remove the elements before the =cut, the semantics change:

    codehere

    =cut

    codehere

Here, =cut marks a "Start of POD" and the second codehere is deemed "in the POD".

This module attempts to keep the document "consistent" by not emitting =cut unless a preceding =command is seen in the output.

Additionally, this module will warn if elements are posted to it in ways that are likely to cause errors, for instance:

  • A POD Text element outside a POD region

  • A Non-POD element inside a POD region

The specific behaviour occurred when hitting these errors can be customised via sub-classing, and overriding "write_text_outside_pod" and "write_nonpod_inside_pod"

METHODS

set_inpod

clear_inpod

is_inpod

write_text_outside_pod

Is called when a text event is seen but we don't appear to be inside a POD region.

    $recon->write_text_outside_pod( $orig_method, $event );

Default implementation warns via Carp and then emits the element anyway, via

    $self->$orig_method( $event )

write_nonpod_inside_pod

Is called when a nonpod event is seen but we appear to be inside a POD region.

    $recon->write_nonpod_inside_pod( $orig_method, $event );

Default implementation warns via Carp and then emits the element anyway, via

    $self->$orig_method( $event )

ATTRIBUTES

inpod

AUTHOR

Kent Fredric <kentfredric@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Kent Fredric <kentfredric@gmail.com>.

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




Hosting generously
sponsored by Bytemark