NAME
Glitch - Exception Handling.
VERSION
Version 0.04
SYNOPSIS
package Foo;
use Glitch;
sub bar {
do { ... } or glitch('one', message => 'Create a new glitch error message');
... later in your code you can then reuse glitch 'one'
do { ... } or glitch('one');
}
...
package Foo;
use Glitch (
one => {
message => 'Create a new glitch error message'
},
two => {
message => 'A different glitch error message',
fileName => '',
}
);
sub bar {
eval {
do { ... } or glitch('one');
...
do { ... } or glitch('two', fileName => 'abc');
};
if ($@) {
do { ... } if $@->name eq 'one';
do { ... } if $@->name eq 'two';
}
}
1;
...
package Glitches;
use Glitch (
one => {
message => 'Create a new glitch error message'
},
two => {
message => 'A different glitch error message',
fileName => '',
}
);
1;
package Foo;
use Glitch;
use Glitches;
sub bar {
eval {
do { ... } or glitch('one');
...
do { ... } or glitch('two', fileName => 'abc');
};
if ($@) {
if ($@->name eq 'one') { ... }
elsif ($@->name eq 'two') { ... }
}
}
1;
EXPORT
glitch
AUTHOR
LNATION, <email at lnation.org>
BUGS
Please report any bugs or feature requests to bug-glitch at rt.cpan.org
, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Glitch. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Glitch
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
CPAN Ratings
Search CPAN
ACKNOWLEDGEMENTS
LICENSE AND COPYRIGHT
This software is Copyright (c) 2022 by LNATION.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)