We relaunched the TWiki.org project with an expanded TWiki charter, and we invite you to participate! The TWiki.org Code of Conduct agreement took effect on 27 Oct 2008. We ask existing twiki.org users to opt-in. You need to opt-in to participate in the Blog, Codev, Plugins and TWiki webs. -- PeterThoeny - 27 Oct 2008
You are here: TWiki> Plugins Web>PerlSamplePlugin (16 May 2004, ThomasWeigert)
Tags:
development1Add my vote for this tag create new tag
, view all tags
+++ Perl examples Plugin

[ move all devel chit chat to PerlSamplePluginDev ]

This plugin nicely formats a Perl piece of code, together with its STDOUT and STDERR outputs.

  • To avoid unproper usage it executes the Perl code in a Safe compartment.

His brother is the TWiki:Main.PrologSamplePlugin

TODO:

  • Apply a timeout to the perl execution (spawn a delayed kill process)
  • Limit the output size (disk quota?)
  • Use a random generated file for the output/stderr

Usage example

You type: You get: If correctly installed:
 
%PERLSAMPLE{ 
print "hello world!"; 
}%  
code return
1
print "hello world!";
stdout stderr
 1: hello world! 
 
%PERLSAMPLE{print "hello world!";}%

Settings

  • One line description, is shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = This plugin nicely formats a Perl piece of code, together with its STDOUT and STDERR outputs.

Installation

  • Install the Safe Perl module (included since perl 5.005_04)
  • Unzip the PerlSamplePlugin.zip file in your TWiki installation directory.
  • double check that bin/perl_stdout.tmp and bin/perl_stderr.tmp are writable by the Apache user.

If the installation is correct you will see a nice table showing the code, its value and stdout/stderr near the example.

-- TWiki:Main.AndreaSterbini and TWiki:Main.FrancoBagnoli -- 27 Nov 2001

Topic attachments
I Attachment Action Size Date Who Comment
zipzip PerlSamplePlugin.zip manage 3.0 K 27 Nov 2001 - 08:20 AndreaSterbini  
Topic revision: r6 - 16 May 2004 - 04:27:08 - ThomasWeigert
 
TWIKI.NET
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback