GX::Callback - Callback class
# Load the class use GX::Callback; # Create a new callback object $callback = GX::Callback->new( sub { say @_ } ); # Execute the callback $callback->call( "Hello world!" );
This module provides the GX::Callback class which extends the GX::Class::Object class.
new
Returns a new GX::Callback object.
$callback = GX::Callback->new( %attributes );
arguments ( ARRAY reference )
arguments
ARRAY
A reference to an array with arguments to pass to the callback subroutine when it is called.
code ( CODE reference ) [ required ]
code
CODE
A reference to the callback subroutine.
$callback ( GX::Callback object )
$callback
GX::Exception
Alternative syntax:
$callback = GX::Callback->new( $code );
$code ( CODE reference )
$code
Returns the callback subroutine arguments.
@arguments = $callback->arguments;
@arguments ( scalars )
@arguments
call
Calls the callback subroutine.
$callback->call( @arguments );
Additional arguments to pass to the callback subroutine.
Returns a reference to the callback subroutine.
$code = $callback->code;
The following classes inherit directly from GX::Callback:
GX::Action
GX::Callback::Method
GX::Callback::Hook
GX::Callback::Hook::Queue
GX::Callback::Queue
Jörg A. Uzarek <uzarek@runlevelnull.de>
Copyright (c) 2009-2011 Jörg A. Uzarek.
This module is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License Version 3 as published by the Free Software Foundation.
To install GX, copy and paste the appropriate command in to your terminal.
cpanm
cpanm GX
CPAN shell
perl -MCPAN -e shell install GX
For more information on module installation, please visit the detailed CPAN module installation guide.