- or download this
package Bio::Phylo::Exceptions;
use Exception::Class (
...
{ isa => 'Bio::Phylo::Exceptions' }
);
1;
- or download this
use Scalar::Util qw(looks_like_number);
...
? $self->{'NUMBER'} = $number
: Bio::Phylo::Exceptions::BadNumber->throw(error => 'bad number');
}
- or download this
# try
eval { $obj->set_number(sdf7897) };
...
if (UNIVERSAL::isa($@,'Bio::Phylo::Exceptions::BadNumber')){
# do something
}