[Bioperl-l] Annotated.pm

Aaron J. Mackey amackey at pcbi.upenn.edu
Sun Nov 28 11:22:11 EST 2004



Allen Day wrote:

> > if you're not sure how many annotations there are, you'd better call it in
> list context unless you want the count:
> 
> my @value = $feature->get_Annotations('key1');
> my $count = $feature->get_Annotations('key1');
> 
> but if you're sure there is only one, you can call it either way:
> 
> my @value = $feature->get_Annotations('key2');
> my $value = $feature->get_Annotations('key2');

This is the kind of thing that, while cute, makes BioPerl really hard to 
teach to newcomers who expect things to be consistently one way or the 
other.  To use DBI as a (formidable) example, when I call 
$sth->fetchrow(), I'm going to get back an array, even if there was only 
one column in that row.  I didn't see this "short cut" slip by, but I'm 
really against things like this when they're not implemented 
project-wide, sorry.  Something else for bioperl-nouveau ...

-Aaron


More information about the Bioperl-l mailing list