| HTML::Mason::Compiler::ToObject(3pm) | User Contributed Perl Documentation | HTML::Mason::Compiler::ToObject(3pm) |
HTML::Mason::Compiler::ToObject - A Compiler subclass that generates Mason object code
my $compiler = HTML::Mason::Compiler::ToObject->new;
my $object_code =
$compiler->compile( comp_source => $source,
name => $comp_name,
comp_path => $comp_path,
);
This Compiler subclass generates Mason object code (Perl code). It is the default Compiler class used by Mason.
All of these parameters are optional.
The default, "auto", will cause the hash to be defined only if some part of the component contains the string "ARGS". This is somewhat crude, and may result in some false positives, but this is preferable to false negatives.
Not defining the args hash means that we can avoid copying component arguments, which can save memory and slightly improve execution speed.
All of the above properties have read-only accessor methods of the same name. You cannot change any property of a compiler after it has been created (but you can create multiple compilers with different properties).
This class is primarily meant to be used by the Interpreter object, and as such has a very limited public API.
This subclass also accepts a "comp_class" parameter, allowing you to override the class into which the component is compiled.
| 2024-03-05 | perl v5.38.2 |