Stupid Carbon Tricks

pudge on 2002-12-11T14:07:34

On the macosx@perl mailing list, it was asked how to quit an app. Many people suggested AppleScript. But, as I am fond of saying, I hate AppleScript. So:

#!/usr/bin/perl -w use POSIX 'SIGTERM'; use Mac::Processes; while (my($psn, $psi) = each %Process) { next unless $psi->processName eq 'Mozilla'; kill SIGTERM, GetProcessPID($psn); last; }

Now Playing: What A Wonderful World - Russ Taff (A Christmas Song)