Mac::SleepEvent - run Perl code on Mac OS X sleep and wake events
use Mac::SleepEvent; my $sn = Mac::SleepEvent->new( wake => sub {print "Waking up...\n"}, sleep => sub {print "Going to sleep\n"}, logout => sub {exit(0)}, ); $sn->listen;
Mac::SleepEvent provides callbacks to run code when Mac OS X goes to sleep, wakes up, or logs out (same as shutdown). When the listen method is called, the program will enter a run loop, awaiting events from the OS.
Mac::SleepEvent requires the Foundation module, which is only included with the OS X system perl.
This will start the run loop.
Lee Aylward <leedo@cpan.org>
Copyright 2009 Lee Aylward.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
2 POD Errors
The following errors were encountered while parsing the POD:
'=item' outside of any '=over'
You forgot a '=back' before '=head1'
To install Mac::SleepEvent, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mac::SleepEvent
CPAN shell
perl -MCPAN -e shell install Mac::SleepEvent
For more information on module installation, please visit the detailed CPAN module installation guide.