Konstrukt::Event - Event management
#Register for an event: #register an object method: $Konstrukt::Event->register("eventname", $object, \&sub_reference); #note that duplicate entries will be ignored #deregister from an event: #only deregister this method from the specified event: $Konstrukt::Event->deregister("eventname", $object, \&sub_reference); #deregister all registered method for a specified object: $Konstrukt::Event->deregister_all_by_object("eventname", $object); #fire an event: #the optional arguments will be passed to the registered methods $Konstrukt::Event->trigger("eventname"[, arg1[, arg2[, ...]]]);
This module provides event handling within the Konstrukt framework. You may register object methods for events and you may also fire events, on which the registered methods are called. This will help synchonizing some parts/plugins of the framework without glueing them together too tightly.
For a detailed description of the usage of this module see "SYNOPSIS"
Constructor of this class
Initialization of this class
Registers an object method for a specified event
Parameters:
$eventname - The name of the event.
$objectref - Reference to the object, whose method should be called
$methodref - Reference to the method, which should be called
Deregisters an object method for a specified event
$objectref - Reference to the object, whose method should be deregistered
$methodref - Reference to the method, which should be deregistered
Deregisters all registered methods of an object from a specified event
Triggers an event with the specified name and the passed arguments.
($arg1, $arg2, ...) - Optional: Arguments that should be passed to the methods
Copyright 2006 Thomas Wittek (mail at gedankenkonstrukt dot de). All rights reserved.
This document is free software. It is distributed under the same terms as Perl itself.
Konstrukt
To install Konstrukt, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Konstrukt
CPAN shell
perl -MCPAN -e shell install Konstrukt
For more information on module installation, please visit the detailed CPAN module installation guide.