AW: Runrev using Perl

Tiemo Hollmann TB toolbook at kestner.de
Mon Jun 4 03:51:58 EDT 2007


Servus Franz,
nice to meet you again. Interesting things you're doing there :)
I am not familiar with shell commands yet, nor perl, but how do you get a
result from the shell execution back into a runrev field "feedback"?
Tiemo

-----Ursprüngliche Nachricht-----
Von: use-revolution-bounces at lists.runrev.com
[mailto:use-revolution-bounces at lists.runrev.com] Im Auftrag von
runrev at animabit.de
Gesendet: Montag, 4. Juni 2007 09:40
An: use-revolution at lists.runrev.com
Cc: boehmisch at animabit.de
Betreff: Runrev using Perl

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