leedo > Mac-SleepEvent-0.02 > Mac::SleepEvent

Download:
Mac-SleepEvent-0.02.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
Stalled  1
View/Report Bugs
Module Version: 0.02   Source  

NAME ^

Mac::SleepEvent - run Perl code on Mac OS X sleep and wake events

SYNOPSIS ^

  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;

DESCRIPTION ^

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.

CAVEATS ^

Mac::SleepEvent requires the Foundation module, which is only included with the OS X system perl.

METHODS ^

listen

This will start the run loop.

AUTHORS ^

Lee Aylward <leedo@cpan.org>

COPYRIGHT ^

Copyright 2009 Lee Aylward.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: