NAME
Text::Oyster - evaluate perl code embedded in text.
SYNOPSIS
use Text::Oyster;
my $o = new Text::Oyster ({
hash => {
name => 'Santa Claus',
age => 9000
},
text => q{
Yo nombre es [- $name -].
I am [- $age -] years old.
}
});
print $o->parse();
DESCRIPTION
Text::Oyster
a module for evaluating perl embedded in text. The perl can be evaluated under a specified package, or under a package built from a provided hash.
FUNCTIONS
- 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').
- autoclean();
-
Should Oyster cleanup at DESTROY?
CHANGES
0.27 - Added package data cleanup method, optional autocleaning at DESTROY. 0.26 - Another name change...just cuz. 0.26 - Bug Fix: Internal package cleanup now works correctly when using hashes. REALLY! 0.25 - Name Change: Was stomping on a Template Toolkit module. Doh! 0.24 - Bug Fix: Internal package cleanup now works correctly when using hashes. 0.23 - Can now specify a package underwhich to install a hash (was explicitly 'Safe'). This also means that the package name must be set prior to or at the time of installation of a hash, or not at all.
Changed default delimiters to '<?' and '?>' (was '[-' and '-]').
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