logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Template::Alloy::Play - Play role - allows for playing out the AST

Author

       Paul Seamons <paul@seamons.com>

Description

       The Template::Alloy::Play role allows for taking the AST returned by the Parse role, and executes it
       directly.  This is in contrast Template::Alloy::Compile which translates the AST into perl code and then
       executes the perl code.

License

       This module may be distributed under the same terms as Perl itself.

perl v5.38.2                                       2024-03-07                         Template::Alloy::Play(3pm)

Name

       Template::Alloy::Play - Play role - allows for playing out the AST

Role Methods

       "play_tree"
           Takes  the  AST output of load_tree and executes it directly.  It should be passed an AST tree and an
           output string reference that the content will be appended to.

               my $tree = $self->load_tree('somefile');
               my $out = '';
               $self->play_tree($tree, \$out);

       "play_*"
           Methods by these names are used by execute_tree to execute the parsed tree.

See Also