App::Modular::Module::Events

App::Modular::Module::Events is a Perl module with event handling for App::Modular compatible applications.
Download

App::Modular::Module::Events Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Baltasar Cevc
  • Publisher web site:
  • http://search.cpan.org/~bcevc/App-Modular-0.1.2/contrib/Events.mom

App::Modular::Module::Events Tags


App::Modular::Module::Events Description

App::Modular::Module::Events is a Perl module with event handling for App::Modular compatible applications. App::Modular::Module::Events is a Perl module with event handling for App::Modular compatible applications.SYNOPSIS #################################################################### package App::Modular::Module::Me; use base qw(App::Modular::Module); sub depends { return 'Events'; } sub start_listen { my $self = shift; $self->{'modularizer'}->module('Events')-> register('Listener', 'TelephoneRings'); }; sub event_handler { my $self = shift; my $event = shift; print 'Yeah! Somebody thought about me!' if ($event eq 'TelephoneRings'); }; #################################################################### package App::Modular::Module::You; use base qw(App::Modular::Module); sub depends { return 'Events'; } sub call_me { $self->{'modularizer'}->module('Events')-> trigger('TelephoneRings'); }; #################################################################### package main; use App::Modular; my $modul = instance App::Modular; $modul->module('Me')->start_listen(); $modul->module('You')->callme(); exit;App::Modular aims to provide a framework which should it make very easy to programmes to create any kind of modular program.This module provides basic event handling as a contribution to that toolkit. Modules may register themselves as listeners for events, if an event is triggered, all the modules are notified by calling $module-event_handler('event', @params) >.The events are speciefied as simple strings. Requirements: · Perl


App::Modular::Module::Events Related Software