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

Re: [MacPerl] Unix daemons in Perl on MacOS?



>good point - how about having the mac *speak* the message?  this is
>something that would work with standard os software, and would be difficult
>to duplicate on unix/linux with standard software.

Shades of the Talking Moose!  A faceless background app that pops up at random intervals with a spoken message!  And Mac::Speech is something of a specialty of mine!  Actually, this is VERY doable, and the nice part is, I won't have to write any new code for most of it.

However, before I can go that step, I still have to show that one can write a faceless app in MacPerl at all.  I believe it's only a matter of writing a BEGIN block in which one sets the 'modeOnlyBackground' flag.  However, I need to read up.  As a background-only app, there'll be no menubar of its own to flash, so it will have to do something else (perhaps tell the finder to flash the menubar (sounds like  a job for Mac::Glue)), or since you've mentioned it, the speaking thing sounds real interesting.

Meanwhile, on the topic of writing a 'polite' process, I dug up this little gem from Chris Nandor's Apple Event Tutorial:

#!perl -w

use Mac::Processes;

foreach my $psi (values %Process) {
	printf("%s %s\n",
	$psi->processSignature(),
	$psi->processName()
    );
}

Which on my Mac reveals the following:

MACS Finder
CRON Cron
R*ch BBEdit 5.1
McPL MacPerl
MMan Claris Emailer 1.1v3
…uck Shuck

Yup, that's an OLD version of Claris Emailer, and sure enough, Cron is indeed alive and well.  Also you can see I've got my Perl Development Environment (sans Toolserver) up and running.  Cron will (or is supposed to) occasionally launch Macjordomo which polls it's POP3 accounts for messages. (someday I'm going to set up a dedicated listserver).

Actually, a previous run of the above Perl script revealed a couple rouge processes.  These were background programs installed by AfterDark (which I no longer use) and AOL (ditto), that didn't get pulled when their applications went away.  This points to the need for something analogous to 'kill' on Unix.  Perhaps a tool for tracking all current processes...  Le'see, doesn't need it's own menu, needs to poll for current processes and display them somehow.  How 'bout a faceless background app that checks to see what other processes are running and displays a list of them in a floating windoid?  I'm almost there!

--B

Brian McNett, Webmaster
*************************************************************
Mycoinfo. The world's first mycology e-journal.
http://www.mycoinfo.com/
*************************************************************


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