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

Re: [MacPerl] Self-updating Perl script ("exec" equivalent)?



At 1:45 PM -0400 1999-08-15, Chris Nandor wrote:
>At 12.40 -0700 1999.08.13, Tom Sackett wrote:
>>For most housekeeping tasks, this works great. However, I also need,
>>sometimes, to update the client script itself, which means that client
>>script has to terminate and be re-launched. This was easy to implement in
>>Windows using "exec," but I can't find a way to do it in MacPerl.
>
>There is no clean way to do it.  Search on the list archives for
>"launchotherperl.plx".  It is a kludge to make a copy of the MacPerl app,
>and then launch it with another script.  Under Mac OS, each app can only be
>running once, so you need copies.  That script might do what you need, even
>if it takes a bit of modification.

Yuck, it would be cleaner to have a dedicated executable for this.  Copy
the file over yourself, launch the program with an Apple event telling it
where you are, and exit.  The program sends MacPerl an event telling it to
run the script and exits.  Really easy stuff if you've already got a
framework for sending and receiving Apple events.  If you simply want to
reexec the script and not actually run two scripts simultaneously, I'd say
this is the way to go.

Josh

--
Joshua Juran                          Metamage Software Creations
=)                                         Tools for Wizards
wanderer@metamage.com
<http://www.metamage.com/>   * Creation at the highest state of the art *



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