[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] That Do Script thing



The following works, but is not particularly elegant:

---start calling AppleScript---
set PerlArgs to "$a1 = 'x'; $a2 = 'y';"
set PerlFile to "disk:folder:perlscript"

set myFile to (open for access file PerlFile)
set PerlScript to (read myFile)
close access myFile

tell application "MacPerl"
   set r to (Do Script (PerlArgs & PerlScript & "MacPerl::Reply($result)"))
end tell
---end calling AppleScript---

---start called Perl script---
#!perl

$result = $a1 . $a2;
---end called Perl script---

I'm wondering if it is possible to pass a list of strings and let the 
Perl script return a value, e.g.

   set r to (Do Script (PerlScript, aList))

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org