GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
App::PFM::Abstract(3) User Contributed Perl Documentation App::PFM::Abstract(3)

App::PFM::Abstract

The PFM Abstract class from which the other classes are derived. It defines shared functions.

_init()
Stub init method to ensure it exists.
_clone()
Stub clone method to ensure it exists.
new( [ array @args ] )
Constructor for all classes based on App::PFM::Abstract.

The args are passed to the _init() methods of individual classes.

clone( [ array @args ] )
Clone one object to create an independent one. By providing a _clone() method, each class can define which contained objects must be recursively cloned.

The args are passed to the _clone() methods of individual classes.

register_listener(string $event_name, coderef $code)
Register the code reference provided as listener for the specified event. For an example, see below under fire().
unregister_listener(string $event_name [ , coderef $code ] )
If a code argument is provided, unregisters it as listener for the specified event. If no code argument is provided, unregisters all listeners for the specified event.
fire(App::PFM::Event $event)
Fire an event. Calls all event handlers that have registered themselves. Returns the handler results as an array or joined string, or '0 but true' if there are no handlers.

Example usage:

        package Parent;

        sub start()
        {
                my $onGreet = sub {
                        my $event = shift;
                        my $who = $event->{data};
                        system "xmessage 'Hello, $who!'";
                };
                $child = new Child();
                $child->register_listener('greetWorld', $onGreet);
                $child->do_something();
        }

        package Child;

        sub do_something()
        {
                my $self = shift;
                $self->fire(App::PFM::Event->new({
                        name => 'greetWorld', 
                        data => 'Fred'
                }));
        }
    
debug()
Dumps the contents of this object using Data::Dumper(3pm). Primarily used for debugging.

pfm(1).
2014-04-09 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.