[Bioperl-l] invalid species name error handling

Heikki Lehvaslaiho heikki at sanbi.ac.za
Mon Apr 24 18:53:25 UTC 2006


Stefano,

If you want to ignore the error, you need to put the offending line(s) inside 
an eval block. 

The following example is from 'perldoc -f eval':

eval {
    $answer = $a / $b;
};
warn $@ if $@;


Note the ';' after the curly bracket closing teh eval block.


	-Heikki

On Monday 24 April 2006 15:48, Stefano Ghignone wrote:
> Hi all.
> I have a problem with a script that extracts the species name from GenPept
> flat files, querying the database with a list of acc.no. When it encounters
> an invalid species name (e.g. Cryptococcus neoformans var. neoformans
> JEC21), it exits definitely with an exception error. I don't know how to
> handle this error, and make the script pass to the next value. I suppose I
> have to use Bio::Root::Exception and Bio::Root::Root but I don't know how
> to start. Who can help me with some hints?
> stefano
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l

-- 
______ _/      _/_____________________________________________________
      _/      _/
     _/  _/  _/  Heikki Lehvaslaiho    heikki at_sanbi _ac _za
    _/_/_/_/_/  Associate Professor    skype: heikki_lehvaslaiho
   _/  _/  _/  SANBI, South African National Bioinformatics Institute
  _/  _/  _/  University of Western Cape, South Africa
     _/      Phone: +27 21 959 2096   FAX: +27 21 959 2512
___ _/_/_/_/_/________________________________________________________



More information about the Bioperl-l mailing list