Winfried Trumper > Text-Placeholder-0.04 > Text::Placeholder::Group::Generic

Download:
Text-Placeholder-0.04.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

Text::Placeholder::Group::Generic - a basket to be filled with placeholders

SYNOPSIS ^

        use Text::Placeholder;
        my $placeholder = Text::Placeholder->new(
                my $generic = '::Generic');
        $generic->add_placeholder('some_value', sub { return(time()%86400) });

        $placeholder->compile('Some value: [=some_value=]');
        print ${$placeholder->execute()}, "<-\n";

DESCRIPTION ^

Text::Placeholder::Group::Generic provides no placeholders by default. Any sense has to be added via add_placeholder (see below). Keep in mind that the placeholders have to be added before compilation.

METHOD REFERENCE (API) ^

add_placeholder($placeholder, $code_ref)

Adds the $code_ref under the name of $placeholder. $code_ref is executed and returns the current value to be substituted for $placeholder.

KNOWN BUGS AND LIMITATIONS ^

This is the first public release.

AUTHOR ^

Winfried Trumper <pub+perl(a)wt.tuxomania.net>

COPYRIGHT AND LICENSE ^

Copyright (C) 2011 Winfried Trumper

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

syntax highlighting: