Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

49 lines (35 sloc) 0.751 kb
## Used in the examples to reduce LOC by declaring fucntions that are used
## over and over in this module
# vim: ts=2 sw=2 noexpandtab
package ExampleHelpers;
use warnings;
use strict;
use POSIX qw(strftime);
use Exporter;
use base qw(Exporter);
our @EXPORT_OK = qw(eg_say eg_object);
sub eg_say {
my $message = join("", @_);
print strftime("%F %T", localtime()), " - ", $message, "\n";
sub eg_object {
my $name = shift;
return ExampleObject->new($name);
# An example object.
package ExampleObject;
use warnings;
use strict;
sub new {
my ($class, $name) = @_;
return bless {
name => $name,
}, $class;
sub handler_method {
my $self = shift;
ExampleHelpers::eg_say("$self->{name} handled an event");
Jump to Line
Something went wrong with that request. Please try again.