summaryrefslogtreecommitdiff
path: root/lib/PerlDaemonModules/ExampleModule2.pm
blob: 74fdd050ef6d9a7a59b8d42748b8ca63e23ee553 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# PerlDaemon (c) 2010, 2011, Dipl.-Inform. (FH) Paul Buetow (http://perldaemon.buetow.org)

package PerlDaemonModules::ExampleModule2;

use strict;
use warnings;

sub new ($$$) {
	my ($class, $conf) = @_;

	my $self = bless { conf => $conf }, $class;

        # Store some private module stuff
        $self->{counter} = 0;

        return $self;
}

# Runs periodically in a loop (set interval in perldaemon.conf)
sub do ($) {
	my $self = shift;
	my $conf = $self->{conf};
	my $logger = $conf->{logger};

        # Calculate some private module stuff
        my $count = ++$self->{counter};

	$logger->logmsg("ExampleModule2 Test $count");
}

1;