---
name: "Template::Alloy::Play"
section: "3pm"
platform: "linux"
package: "libtemplate-alloy-perl"
version: "1.022-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Template::Alloy::Play"
---

# Template::Alloy::Play(3pm)

Play role - allows for playing out the AST

## NAME

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

## 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.

## 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.

## AUTHOR

Paul Seamons \<paul@seamons.com\>

## LICENSE

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