Clownfish::Err - Exception.
package MyErr; use base qw( Clownfish::Err ); ... package main; use Scalar::Util qw( blessed ); while (1) { eval { do_stuff() or MyErr->throw("retry"); }; if ( blessed($@) and $@->isa("MyErr") ) { warn "Retrying...\n"; } else { # Re-throw. die "do_stuff() died: $@"; } }
Clownfish::Err is the base class for exceptions in the Clownfish object hierarchy.
The Err module also provides access to a per-thread Err shared variable via set_error() and get_error(). It may be used to store an Err object temporarily, so that calling code may choose how to handle a particular error condition.
$err->cat_mess($mess);
Concatenate the supplied argument onto the error message.
my $string = $err->get_mess();
Return the error message.
Clownfish::Err isa Clownfish::Obj.
To install Clownfish, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Clownfish
CPAN shell
perl -MCPAN -e shell install Clownfish
For more information on module installation, please visit the detailed CPAN module installation guide.