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

Re: [MacPerl] Running an MPW Tool within MPWs MacPerl?



Paul Steinkamp <steinkam@apple.com> writes:
>Due to some of the *lovely* aspects of MPW quoting, I'd like to convert a 
>series of my current MPW scripts to the ease and consistency!! of 
>MacPerl. My major block at this point is that the Perl scripts will 
>definitely have to call some MPW tools. 
>
>Is there a way in MacPerl to invoke an MPW tool without having to also 
>have toolserver running?

There definitely has to be something MPW Shellish running, but I see two 
ways in which it can be made something else than toolserver:

 - You can send a "Do Script" event to the MPW *Shell* if the shell is running
   anyway.
 - You can run your script with the MPW version of Perl and do a maneuver I
   call the "MPW Shuffle":

perl -Sx "{0}" One {Param1}
... MPW Shell stuff ...
perl -Sx "{0}" Two {param2}
... MPW Shell stuff ...
perl -Sx "{0}" Three {Param3}
Exit {Status}

#!perl

$what = @ARGV;

if ($what eq "One") {
  .. Perl stuff...
} elsif ($what eq "Two") {
  .. Perl stuff...
}

... and so on. Works great if there are not too many MPW Tools involved.

Matthias

-----
Matthias Neeracher   <neeri@iis.ee.ethz.ch>   http://www.iis.ee.ethz.ch/~neeri
   "I'm set free to find a new illusion" -- Velvet Underground

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