[Bioperl-l] Bio::DB::Query::GenBank errors

Rob Edwards redwards at utmem.edu
Mon Jun 28 13:38:33 EDT 2004


eval should catch the error.


eval {$count=$queryobject->count};
if ($@) {
   print "No results returned"
}

Rob


On Jun 28, 2004, at 12:15 PM, Jonathan Manning wrote:

> Hi all,
>
> Apologies for the somewhat fundamental question, but I haven't been 
> able
> to find answers myself, and it should be a quickie.
>
> How do I tell if a Bio::DB::Query::Genbank has not retrieved any 
> results
> without calling any methods (since this causes the script to crash out
> with an exception if there's no results).
>
> Since count() or ids() are unavailable for the purpose I tried:
>
> - if ($queryobject)
> - if (ref($queryobject))
> - if (defined($queryobject))
>
> (I realise I was clutching at straws a bit there), but to no avail.
>
> Help appreciated!
>
> Jon
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l



More information about the Bioperl-l mailing list