You are here: Foswiki>Extensions Web>Macros? >VarPERL (11 Nov 2010, PadraigLennon) Edit this topic text (e) Attach an image or document to this topic; manage existing attachments (a) View sequential topic history View without formatting (v) Create new topic Printable version of this topic (p) More: delete or rename this topic; set parent topic; view and compare revisions (m)

%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 %PERL{"'A String'"}%
  • %PERL{"101 - 59"}% expands to %PERL{"101 - 59"}%
  • %PERL{topic="System.VarPERL"}% expands to %PERL{topic="VarPERL"}%

Perl code used for this example:
%CODE{"perl"}%
my $x = 99;
$x = $x + 1;
return $x;
%ENDCODE%
Topic revision: 11 Nov 2010, PadraigLennon
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons LicenseGet Foswiki at sourceforge.net. Fast, secure and Free Open Source software downloads