summaryrefslogtreecommitdiff
path: root/lib/PerlDaemonModules/ExampleModule2.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PerlDaemonModules/ExampleModule2.pm')
-rw-r--r--lib/PerlDaemonModules/ExampleModule2.pm31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/PerlDaemonModules/ExampleModule2.pm b/lib/PerlDaemonModules/ExampleModule2.pm
new file mode 100644
index 0000000..948f24a
--- /dev/null
+++ b/lib/PerlDaemonModules/ExampleModule2.pm
@@ -0,0 +1,31 @@
+# PerlDaemon (c) 2010, 2011, Dipl.-Inform. (FH) Paul Buetow (http://perldaemon.buetow.org)
+
+package PerlDaemonModules::ExampleModule;
+
+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;