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

Re: [MacPerl] That Do Script thing



---RE---
From: "Mikael Hansen" <meh@dnai.com>
To: <macperl@macperl.org>
Sent: Thursday, September 07, 2000 3:59 PM
Subject: Re: [MacPerl] That Do Script thing


> At 08:13 -0400 9/7/2000, Chris Nandor wrote:
>
> >  >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))
>
> >tell application "MacPerl"
> >    set r to (Do Script [PerlScript & "MacPerl::Reply($result)", "x",
"y"))
> >end tell
> >
> >@ARGV is populated with extra argumenrs to Do Script.
>
> At 21:41 +0900 9/7/2000, Gero Herrmann wrote:
>
> >The Do Script command takes a list value of which the first can contain
> >either the text of a Perl script or the path to a MacPerl script saved in
any
> >form. The rest of the elements of the list go into the @ARGV array.
>
> That unfortunately is a somewhat cumbersome approach when you have a
> different number of arguments from time to time and if you have many
> arguments. It would be so nice if one passed argument of type list
> would go straight into @ARGV. Please consider this a request for a
> future version of MacPerl.
I think that's how it works right now.
For example:
set theScript to "Macintosh HD:test"
set theArgs to {"arg1", "arg2"}
tell app "MacPerl.PPC" to Do Script [theScript & theArgs]

>
> Please also consider implementing "return" for the main "subroutine".

The function MacPerl::Reply() does that. (NOTE: This will only set the
return value, it will not end execution. Use exit to stop executing the
script)
>
> Thanks.



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