| Bio-Phylo documentation | Contained in the Bio-Phylo distribution. |
Bio::Phylo::Util::OptionalInterface - Utility class for managing optional superclasses. No serviceable parts inside.
This package is for optionally importing superclasses or interfaces and placing them above the importing class in the inheritance tree. This is principally used for managing the relationship with BioPerl.
Also see the manual: Bio::Phylo::Manual and http://rutgervos.blogspot.com.
If you use Bio::Phylo in published research, please cite it:
Rutger A Vos, Jason Caravas, Klaas Hartmann, Mark A Jensen and Chase Miller, 2011. Bio::Phylo - phyloinformatic analysis using Perl. BMC Bioinformatics 12:63. http://dx.doi.org/10.1186/1471-2105-12-63
$Id: IDPool.pm 1593 2011-02-27 15:26:04Z rvos $
| Bio-Phylo documentation | Contained in the Bio-Phylo distribution. |
package Bio::Phylo::Util::OptionalInterface; use strict; use Bio::Phylo::Util::CONSTANT 'looks_like_class'; use Bio::Phylo::Util::Logger; my $logger = Bio::Phylo::Util::Logger->new; sub import { my $class = shift; my ($caller) = caller; for my $iface (@_) { eval { looks_like_class $iface }; if ($@) { $logger->info("Couldn't load optional interface $iface"); undef($@); } else { eval "push \@${caller}::ISA, '$iface'"; $logger->info("Added interface $iface to $caller"); } } } 1; __END__