http://qs321.pair.com?node_id=488519


in reply to Parser object to return different objects

it is impossible to say what is returned by the parser

That's not true though, you can tell what type of the object it is by inspecting the ref of the object returned.

I think your suggestion is workable. Perhaps you want to consider making -I_want switch optional. A more convenient interface would be a standardised approach for every file types, something like...
use Bio::Phylo::Parsers; my $parser = new Bio::Phylo::Parsers; my $collection = $parser->parse( -format => $format, -file => $filenam +e , -I_want => qw/ trees / ); # I_want is optional for my $obj (@$collection) { .... }