I just uploaded Mac::Growl to the CPAN. It is an interface to Growl.
http://growl.info/
I mention it not because you should use Growl -- though you should -- but
because it has some interesting and useful examples of how to use
PerlObjCBridge in it.
http://search.cpan.org/~cnandor/Mac-Growl/lib/Mac/Growl.pm
The module actually uses three methods: PerlObjCBridge, Mac::Glue, and
AppleScript. This way it works out of the box, pretty much anywhere. On
initialization it sees if PerlObjCBridge (Foundation) is available, and if
so, it uses that to send messages directly to the Growl framework.
If that's not available -- because you built your own perl or somesuch --
it tries Mac::Glue, and then falls back to AppleScript (trying one of three
AppleScript modules, before reverting to system('osascript', ...)).
Anyway, over on use.perl.org I found some info for loading other Frameworks
into Perl:
http://use.perl.org/~pemungkah/journal/23339
I used this to load the AppKit framework, which, along with the
CoreFoundation framework, I used to send data and images to Growl. I know
almost nothing about ObjC or Cocoa, but I got it to work, and figured it
might be of some interest.
(Also perhaps of interest: the Makefile.PL automatically creates a glue for
Growl, for Mac::Glue to use, so the user doesn't have to ... feel free to
take that or give tips to me on how it can be improved.)

Signature
Chris Nandor pudge@pobox.com http://pudge.net/
Open Source Technology Group pudge@ostg.com http://ostg.com/
Lola Lee - 03 Mar 2005 21:14 GMT
Chris Nandor said the following on 3/3/05 3:56 PM:
> I just uploaded Mac::Growl to the CPAN. It is an interface to Growl.
Wow . . . this is cool! Now if only I had more hours in a day to study
Perl . . .
At least, reading and rereading the perl docs on my PDA is helping me to
understand the language more and more.

Signature
Lola - mailto:lola@his.com
http://www.lolajl.net | Blog at http://www.lolajl.net/blog/
Terrorismus delendus est! (Terrorism must be destroyed utterly!)
I'm in Bowie, MD, USA, halfway between DC and Annapolis.
Phil Dobbin - 03 Mar 2005 21:34 GMT
>I just uploaded Mac::Growl to the CPAN. It is an interface to Growl.
>
> http://growl.info/
[...]
I just tried installing Mac::Growl from CPAN and it died badly during `make test'
-----------------------------------------------------------
Created and installed App glue for GrowlHelperApp.app (GrowlHelperApp)
/usr/bin/make -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/Mac-Growl....ok 1/11No event 'register' available from glue for 'GrowlHelperApp' at /Users/phil/.cpan/build/Mac-Growl-0.61/blib/lib/Mac/Growl.pm line 205
# Looks like you planned 11 tests but only ran 1.
# Looks like your test died just after 1.
t/Mac-Growl....dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 2-11
Failed 10/11 tests, 9.09% okay
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t/Mac-Growl.t 255 65280 11 10 90.91% 2-11
Failed 1/1 test scripts, 0.00% okay. 10/11 subtests failed, 9.09% okay.
make: *** [test_dynamic] Error 2
/usr/bin/make test -- NOT OK
Running make install
make test had returned bad status, won't install without force
------------------------------------------------------------------------
This is using Perl 5.8.6 (I also tried from source last night and got the same result. I've got Mac::Glue installed BTW).
Any pointers?
Cheers,
Regards,
Phil.