NAME

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

SYNOPSIS

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

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

METHODS

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

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

Steve McKay, steve@colgreen.com

COPYRIGHT

Copyright 2000-2001 Steve McKay. All rights reserved.

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

SEE ALSO

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