From e95d965bc0d4dbf85193953af1e2f498b8a7b0a7 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 13 May 2011 15:19:28 +0000 Subject: ExampleModule.pm works --- lib/PerlDaemonModules/ExampleModule.pm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'lib/PerlDaemonModules') diff --git a/lib/PerlDaemonModules/ExampleModule.pm b/lib/PerlDaemonModules/ExampleModule.pm index 75708f2..58dec1d 100644 --- a/lib/PerlDaemonModules/ExampleModule.pm +++ b/lib/PerlDaemonModules/ExampleModule.pm @@ -3,15 +3,24 @@ package PerlDaemonModules::ExampleModule; sub new ($$$) { my ($class, $conf) = @_; - return bless { conf => $conf }, $class; + 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}; - $logger->logmsg('ExampleModule Test'); + # Calculate some private module stuff + my $count = ++$self->{counter}; + + $logger->logmsg("ExampleModule Test $count"); } 1; -- cgit v1.2.3