NAME
PApp::Parser - PApp format file parser
SYNOPSIS
DESCRIPTION
This module manages papp files (parsing, compiling etc..). Sorry, you have to look at the examples to understand the descriptions here :(
This module exports nothing at the moment, but might soon export phtml2perl
and other nifty functions.
- phtml2perl "pthml-code";
-
Convert <phtml> code to normal perl. The following four mode-switches are allowed, the initial mode is "?>" (i.e. interpolated html).
<: start verbatim perl section ("perl-mode") :> start plain html section (non-interpolated html) <? start perl expression (single expr, result will echo'd) (eval this!) ?> start interpolated html section (similar to qq[...]>)
Within plain and interpolated html sections you can also use the __"string" construct to mark (and map) internationalized text. The construct must be used verbatim: two underlines, one double-quote, text, and a trailing double-quote. For more complex uses, just escape to perl (e.g. <?__"xxx"?>).
White space is preserved all over the html-sections. If you do not like this (e.g. you want to output a png or other binary data) use perl section instead.
In html sections (and only there!), you can also use preprocessor commands (the
#
must be at the beginning of the line, between the#
and the command anme can be any amount of white space, just like in C!)#if any_perl_condition any phtml code #elif any_perl_conditon ... #else ... #endif
And also these experimental preprocessor commands (these currently trash the line number info, though!)
#?? condition ?? if-yes-phtml-code #?? condition ?? if-yes-phtml-code ?? if-no-phtml-code
SEE ALSO
PApp.
AUTHOR
Marc Lehmann <pcg@goof.com>
http://www.goof.com/pcg/marc/