[Bioperl-l] how to catch exception error

Elia Stupka elia@fugu-sg.org
Fri, 7 Jun 2002 18:03:25 +0800 (SGT)


> is there a way in bioperl to catch exception
> as it is possible in Java or C++ ?

Sure, you just need to use the standard perl syntax, which is to wrap the
code you want to catch with an eval statement like this:

eval {

code code code

};

if ($@) { print "The code threw this exception $@";



Elia


********************************
* http://www.fugu-sg.org/~elia *
* tel:    +65 874 1467         *
* mobile: +65 90307613         *
* fax:    +65 777 0402         *
********************************