-
-
28 Mar 2021 07:03:09 UTC
- Distribution: Math-ModInt
- Module version: 0.013
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Repository
- Issues
- Testers (214 / 0 / 0)
- Kwalitee
Bus factor: 1- 100.00% Coverage
- License: artistic_2
- Perl: v5.6.0
- Activity
24 month- Tools
- Download (51.76KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors- Martin Becker <becker-cpan-mp (at) cozap.com>
- NAME
- VERSION
- SYNOPSIS
- DESCRIPTION
- EXPORT
- DIAGNOSTICS
- SEE ALSO
- AUTHOR
- LICENSE AND COPYRIGHT
- DISCLAIMER OF WARRANTY
NAME
Math::ModInt::Event::Trap - catching events triggered by Math::ModInt
VERSION
This documentation refers to version 0.013 of Math::ModInt::Event::Trap.
SYNOPSIS
# event consumer interface: use Math::ModInt::Event::Trap; sub my_handler { my ($event) = @_; # ... insert code here ... return 0; # call no handler after this one return 1; # continue calling subsequent handlers } $trap = Math::ModInt::Event::Trap->new($event, \&my_handler); $trap = Math::ModInt::Event::Trap->new($event, 'ignore'); $trap = Math::ModInt::Event::Trap->new($event, 'warn'); $trap = Math::ModInt::Event::Trap->new($event, 'die'); undef $trap; # discard this trap Math::ModInt::Event::Trap->new($event, \&my_handler); Math::ModInt::Event::Trap->new($event, 'ignore'); Math::ModInt::Event::Trap->new($event, 'warn'); Math::ModInt::Event::Trap->new($event, 'die'); # event producer interface: Math::ModInt::Event::Trap->broadcast($event);
DESCRIPTION
This module is closely related to Math::ModInt::Event and should in general not be directly accessed from application code. Please refer to Math::ModInt::Event for a more user-friendly description of both module's functionalities.
Class Methods
- new
-
Constructor, takes an event object, and a handler coderef or a generic handler name. Returns the new trap object.
- broadcast
-
Notifies active event handlers of an event. Takes an event, returns the number of handlers called.
EXPORT
Math::ModInt::Event::Trap has no exports.
DIAGNOSTICS
Standard warning handlers print
"warning: "
and the short description of the event (like"undefined result"
) on STDERR, followed by a caller source code location.Standard error handlers die with
"error: "
and the short description of the event (like"undefined result"
).SEE ALSO
AUTHOR
Martin Becker, <becker-cpan-mp at cozap.com>
LICENSE AND COPYRIGHT
Copyright (c) 2010-2021 Martin Becker, Blaubeuren.
This library is free software; you can distribute it and/or modify it under the terms of the Artistic License 2.0 (see LICENSE file). at your option, any later version of Perl 5 you may have available.
DISCLAIMER OF WARRANTY
This library is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.
Module Install Instructions
To install Math::ModInt, copy and paste the appropriate command in to your terminal.
cpanm Math::ModInt
perl -MCPAN -e shell install Math::ModInt
For more information on module installation, please visit the detailed CPAN module installation guide.