The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Stenciller::Stencil - One part of a file

VERSION

Version 0.1400, released 2016-02-03.

SYNOPSIS

# In a plugin (this is pretty similar to what ToUnparsedText does)
sub render {
    my $self = shift;
    my @out = ();

    STENCIL:
    foreach my $stencil ($self->stenciller->all_stencils) {
        push @out => join "\n" => $stencil->all_before_input;
        push @out => join "\n" => $stencil->all_input;
        push @out => join "\n" => $stencil->all_between;
        push @out => join "\n" => $stencil->all_output;
        push @out => join "\n" => $stencil->all_after_output;
    }
    return join "\n" => @out;
}

DESCRIPTION

A Stencil is one section of the file format defined in Stenciller.

ATTRIBUTES

before_input

ArrayRef [ Str ] optional, default is a coderef read-only

Holds all lines of the before_input section.

input

ArrayRef [ Str ] optional, default is a coderef read-only

Holds all lines of the input section.

between

ArrayRef [ Str ] optional, default is a coderef read-only

Holds all lines of the between section.

output

ArrayRef [ Str ] optional, default is a coderef read-only

Holds all lines of the output section.

after_output

ArrayRef [ Str ] optional, default is a coderef read-only

Holds all lines of the after_output section.

extra_settings

HashRef optional, default is a coderef read-only

Any extra key-value pairs in the stencil header.

line_number

Int optional read-only

Can be referenced in the output for easier backtracking.

skip

Bool optional, default: 0 read-only

Should the Stencil not be included in the result?

stencil_name

Str optional read-only

Can be given in the stencil hash with 'name'. Depends on used plugins if it is necessary/useful.

SOURCE

https://github.com/Csson/p5-Stenciller

HOMEPAGE

https://metacpan.org/release/Stenciller

AUTHOR

Erik Carlsson <info@code301.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2016 by Erik Carlsson.

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