Acme::Matt::Daemon - MATT DAEMON


Acme-Matt-Daemon documentation Contained in the Acme-Matt-Daemon distribution.

Index


Code Index:

MATT DAEMON

Top

NAME

Top

Acme::Matt::Daemon - MATT DAEMON

VERSION

Top

Version 0.01

SYNOPSIS

Top

MATT DAEMON

    perl -MAcme::Matt::Daemon -e 'MATT DAEMON'

DESCRIPTION

Top

MATT DAEMON

http://www.youtube.com/watch?v=ZWTzyU5MFgM

Acme::Matt::Daemon will daemonize and output MATT DAEMON to your syslog at every 15 to 60 minutes (randomly). Enjoy!

AUTHOR

Top

Robert Krimen, <rkrimen at cpan.org>

BUGS

Top

Please report any bugs or feature requests to bug-acme-matt-daemon at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Acme-Matt-Daemon. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc Acme::Matt::Daemon




You can also look for information at:

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Acme-Matt-Daemon

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/Acme-Matt-Daemon

* CPAN Ratings

http://cpanratings.perl.org/d/Acme-Matt-Daemon

* Search CPAN

http://search.cpan.org/dist/Acme-Matt-Daemon/

ACKNOWLEDGEMENTS

Top

COPYRIGHT & LICENSE

Top

MATT DAEMON

Top


Acme-Matt-Daemon documentation Contained in the Acme-Matt-Daemon distribution.
package Acme::Matt::Daemon;

use warnings;
use strict;

our $VERSION = '0.01';

use vars qw/@ISA @EXPORT/;
@ISA = qw/Exporter/;
@EXPORT = qw/MATT DAEMON DAMON MATTDAMON MATTDAEMON/;

use Log::Syslog::Abstract qw/openlog syslog closelog/;
use Proc::Daemon;

sub MATT {
}

my @interval = map { $_ * 60 } qw/15 60/;
$interval[1] -= $interval[0];

sub DAEMON {

    print "MATT DAEMON\n";

    Proc::Daemon::Init;

    while (1) {
        openlog( 'matt-daemon', '', 'local0' );

        syslog( 'info', '%s', 'MATT DAEMON' );

        closelog;

        sleep($interval[0] + int rand $interval[1]);
    }
}

*DAMON = \&DAEMON;
*MATTDAMON = \&DAEMON;
*MATTDAEMON = \&DAEMON;

'MATT DAEMON'; # End of Acme::Matt::Daemon