%PERL{"perl expression"}%
- Expands to the result of the perl expression, evaluated in a Safe container.
%PERL{topic="topic name"}%
- Expands to the result of the perl program contained between %CODE{}% and %ENDCODE% in the named topic.
- You can only use a subset of perl, as defined in the Foswiki configuration.
Examples
If the plugin is installed, the text after 'expands to' will show the result of the example.
-
%PERL{"'A String'"}%
expands to A String
-
%PERL{"101 - 59"}%
expands to 42
-
%PERL{topic="System.VarPERL"}%
expands to 100
Perl code used for this example:
%CODE{"perl"}%
my $x = 99;
$x = $x + 1;
return $x;
%ENDCODE%