Text::Oyster - evaluate perl code embedded in text.


Text-Oyster documentation  | view source Contained in the Text-Oyster distribution.

Index


NAME

Top

Text::Oyster - evaluate perl code embedded in text.

SYNOPSIS

Top

  use Text::Oyster;

  my $o = new Text::Oyster ({
      hash => {
          name => 'Santa Claus',
          num_presents => 9000
      },
      delimiters => [['<?','?>']],
      text => q{
          Me llamo <? $name ?>.
          Tengo <? $num_presents ?> regalos.
      }
  });

  print $o->parse();

DESCRIPTION

Top

Text::Oyster is a module for evaluating perl embedded in text.

METHODS

Top

new()

Initializes an Oyster object. Pass parameter as a hash reference. Optionally pass: delimiters, hash, package, text, file, inline_errs (see descriptions below).

hash()

Installs values identified by a given hash reference into a package under which to evaluate perl tokens.

text()

Install the text to be parsed as the template.

file()

Specify a file containing the text to be parsed as the template.

inline_errs()

Specify how to handle error messages generated during the evaluation of perl tokens. a true value = inline, a flase value = ignore.

package()

Set the package name under which to evaluate the extracted perl. If used in concert with a hash, the package name must be set prior to installation of a hash.

parse()

Runs the parser. Optionally accepts parameters as specified for new();.

parsed();

Returns the fully parsed and evaluated text.

cleanup();

Cleanup namespace (excludes 'main'). "Cleanup" mean delete all variables contained therein.

autoclean();

Should Oyster cleanup at DESTROY?

CHANGES

Top

0.31

Corrected my dorky spanish...ONE MORE TIME! =item 0.31

Fixed the pod CHANGES. Corrected my really bad spanish in the demo code to be significantly less bad(er). Thanks Belden Lyman.

0.30

Removed an errant warn statement. Build distribution using 'make dist'

0.29

Allow assignment of hash elements with undef values. Uses evaluation package name correctly.

0.27

Added package data cleanup method, optional autocleaning at DESTROY.

AUTHOR

Top

Steve McKay, steve@colgreen.com

COPYRIGHT

Top

SEE ALSO

Top

Parse::Tokens, Text::Template, Text::SimpleTemplate


Text-Oyster documentation  | view source Contained in the Text-Oyster distribution.