Runrev using Perl

runrev at animabit.de runrev at animabit.de
Mon Jun 4 03:39:41 EDT 2007


Hi,

Last week I needed some functions runrev doesn't supply but Perl does. I am working on win and have ActivePerl or Sieperl installed on the PCs. Therefore I wrote a script, which dynamically runs a perl script from runrev.
Create a field "perl", put the perl prog in it, remove all comments = text in a line after # (or write the script for doing this).
Create a field "feedback".

Make a button with the script:

on mouseUp
  put field "perl" into perlprog
  replace cr with empty in perlprog
  put "perl -e " & quote & perlprog & quote into cmdstring
  set the hideconsolewindows to true
  put shell(cmdstring) into field "feedback"
end mouseUp


I tested it with some normal scripts (the result of the script will be expressed in field "feedback").
This allows using Perl modules as extensions of runrev.
You can of course run any perl script from runrev in a file (the normal way) with 
  shell("perl " & fileloc)

Second I tested (on win) some GUI-Skripts in Perl using PerlTk:


use Tk;
my $meinFenster = MainWindow->new; 
$meinFenster->Label( -text=>"Servus" )->pack; 
$meinFenster->Button(-text => "Schluss", -command => [$meinFenster => 'destroy'] )->pack; 
MainLoop; 

On Win and Linux this creates a small GUI window. On Mac there normally is no PerlTk implementation - you have to install it on your own if you need. Tk allows to offer an interface for configuration of parameters of the perl script during runtime.

I will put this info on my (still rudimentary) runrev web pages at http://animabit.de/runrev

Regards, Franz
Mit freundlichen Grüßen
Franz Böhmisch

boehmisch at animabit.de
http://www.animabit.de
GF Animabit Multimedia Software GmbH
Am Sonnenhang 22
D-94136 Thyrnau
Tel +49 (0)8501-8538
Fax +49 (0)8501-8537



To: use-revolution at lists.runrev.com
Cc: boehmisch at animabit.de


More information about the use-livecode mailing list