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

Re: [MacPerl] AppleScript Wrapper for MacPerl acgi



Chris Nandor said:

>As to your question about controlling MacPerl with AppleScript, there are
>several examples in the AppleScript chapter. Further info can be got by
>looking at the MacPerl app from inside Script Editor, or by asking a
>specific question of the list.

I have two "questions". The first is:

1) What questions would I ask if I knew to ask them? :-) The examples in MPPE (as I understand them) all assume that you invoke MacPerl in default mode, which is Local Mode (mode defined below). In fact, if one looks at the MacPerl AppleTalk Dictionary as you suggest, one sees that the call is:

Do Script: Execute a Perl script
Do Script string -- Script to execute
[extract boolean] -- if false, don't search for the #!perl line.
[debug boolean] -- if true, start the Perl debugger.
[taint boolean] -- if true, enable taint checks.
[preprocess boolean] -- if true, send script through C preprocessor.
[mode Local/Batch/Remote/Duplex] -- mode (local, batch, remote, duplex).
[environment string] -- environment variables.
[directory alias] -- working directory.
[Result: string] -- Result

...so that there is something called "mode" with possible values of local, batch, remote, and duplex. I was unable to find any elaboration on these in MPPE or in any of the documentation that came with MacPerl. However, some time ago I came across the following during a Web search:

---=== BEGIN QUOTE ===---
Here is an excerpt from the docs regarding the various modes:
*******
- Local mode is the default. The script just runs and only returns text if
you call &MacPerl'Reply().
- Batch mode redirects standard output and error to the reply apple event.
Standard output is put into the direct parameter of the reply, while
standard error is put into element [diag] of parameter [OUTP].
- Remote control mode returns immediately from the DoScript request.
Clients are then expected to communicate with MacPerl with "Send Data"
[McPL/DATA] events. These contain standard input in the direct parameter
and output as explained above. Furthermore, the 'WANT' parameter of the
reply contains enumeration codes for all input descriptors awaiting input.
Sending a null descriptor with any code signals an end of file for that
file. If you did specify a SASE parameter in your Do Script or Send Data
events, it will be sent back to you the next time MacPerl waits for input.
- Both Batch and Remote control mode support opening further input and
output streams as "Dev:AEVT:[4 byte code]". Standard input/output is
"Dev:AEVT", standard error is "Dev:AEVT:diag". Note that these names are
case sensitive!
********
---=== END QUOTE ===---

Ahah! says I. I must find the referred-to docs, for what other gems might they contain?

2) Specific Question: What is Duplex mode and how does it work?

Thanks for all the help!

-David-

David Steffen, Ph.D.
President, Biomedical Computing, Inc. <http://www.biomedcomp.com/>
Phone: (713) 610-9770 FAX: (713) 610-9769 E-mail: steffen@biomedcomp.com

***** Want to unsubscribe from this list? ***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch