You are using a browser which doesn't fully support Cascading Style Sheets. This site will look much better in a browser that supports web standards, but its content is accessible to any browser or Internet device.
Variables
Variables hold literal portions of PerlPoint code. This is handy for text that appears quite often, like a link address:
$cpan=http://search.cpan.org
Here we meet the typical paragraph approach again. Variables are declared and assigned in special paragraphs beginning with a dollar character and the variable name, followed by the assignment. Everything behind the equal sign is treated as the variables new value - old values will be overwritten.
// a variable value with whitespaces
$whiteVar=variable with whitespaces
To use a variable, we just insert it to the PerlPoint source:
This paragraph makes use of a variable
to point to $cpan.
It's also possible to use it in a tag or macro option:
Search \L{url="$cpan"}<CPAN>.
Variables are very handy to maintain a literal information (like a link) at a central place. In this regard they are similar to macros but evaluated in a different way:
- Variables are resolved once and as literals. Nested variables will not be resolved, nor are any PerlPoint syntax elements that might be included.
- While it is an error to refer to an undefined macro, it is valid to use an undefined variable. Undefined variables are treated as literal text.
- Being pure text, variables can be refered in templates.
Similar to macros, a backslash before a variable guards it from being evaluated.
This \$variable is treated as text.
As an example, I use variables to store document informations such as author name and mail address, document date and version. Making this a convention allows to easily import those informations into generated pages.
// document data
Jochen Stenzel=Jochen Stenzel
perl@jochen-stenzel.de=perl@jochen-stenzel.de
2006-08-06=2005-05-30
0.07=0.02
To reset a variable, just assign nothing:
$var=