Mac Daemons in Perl | WebReference

Mac Daemons in Perl

Mac Daemons in Perl

Introduction

Abstract

On the Mac, under MacPerl (as it's currently written), one can't fork a process, and there's no root to place such a process to begin with. Thus, unless you want to patch the operating system at startup, your process has to live in the application heap with all the other user processes. A true unix-like daemon is not an option (alas) in MacPerl. It is possible, however, to create a runtime application, which is basically a cut-down MacPerl app with just the interpreter and a copy of your code, (and sometimes even all the modules it uses as well, but that's an issue for another day) which it executes.

Required Modules

The heavy lifting in the program is done by three modules: Mac::Processes, Mac::Apps::Launch, and Mac::Speech. Processes.pm and Speech.pm are interfaces to the Mac Toolbox APIs for the Process Manager and Speech manager. As such, the details involving their use are found in Apple's extensive technical tome Inside Macintosh. I've written a quick tutorial on using Mac::Speech, which appeared in issue #6 of PerlMonth. I recommend it, as it's a fun read.


http://www.internet.com

Produced by Brian McNett
All Rights Reserved. Legal Notices.
Created: Feb 4, 2000
Revised: Feb 4, 2000

URL: http://www.webreference.com/perl/tutorial/10/index.html