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

[MacPerl] Launching a script from another script??



Hi,

I have a Perl script that is designed to launch another Perl script and keep
going while the launched script runs in the background. These scripts work
fine on Win32 and Unix -- on those platforms the launching script uses
Win32::CreateProcess or fork, respectively.  I am now trying to port them to
MacPerl, and am starting to have some serious doubts.  Does anyone know if
this is even possible on the Mac? (Please bear with me, I am a relative
newcomer to the Mac environment).  Here are the problems I am seeing:

1. I am using Mac::Process:LaunchApplication() to launch the background
script.  When the first script does the launch, it appears to get completely
blown away by the second script.  This happens whether the second script is
saved as a droplet or as a Runtime.  I wondering whether this is a
limitation of the Mac OS -- that only one copy of an app can be loaded at a
time.  But I expected that a Runtime script would count as a distinct
application which could peacefully coexist with a running copy of MacPerl.

2. When running a script saved as a Runtime object, the @INC variable does
not contain the standard library paths.

3. There appears to be no standard way to pass arguments to a launched
application from a MacPerl script.  Since
Mac::Processes::LaunchApplication() does not provide any way to pass
arguments via the command-line, I decided to try setting an environment
variable, but the environment does not seem to get passed to the launched
application.

Will MPW solve my problems?  Am I barking up the wrong tree?

Thanks,
Todd Schwartz


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