[Bioperl-l] Grrrr. Another subtle overloading bug ...

Lincoln Stein lstein@cshl.org
Mon, 7 Jan 2002 13:04:19 -0500


Perl is supposed to guarantee that $@ is false if no error was returned from 
an eval and true if there was.  However there are nasty problems involving 
nested evals.

I haven't looked at this code, but if you point me at the failure case I'll 
see what I can do.

Lincoln

On Sunday 06 January 2002 15:03, Hilmar Lapp wrote:
> Ewan Birney wrote:
> > Now ... I have commited some tests to fix this but then I realised that
> > this is probably a bad idea and we need to fix things so that
> >
> >   if( $@ ) {
> >    #
> >   }
> >
> > Evaluates to TRUE. SteveC - do you know how to do this. I have spent a
> > fruitless half an hour in perl.com trying to find the overloading
> > documentation.
> >
> > This is a nasty bug and something we have to get right. It also
> > emphasises how important it is to test the 0.9 series before we call it
> > 1.0 otherwise we will just trigger alot of bugs world-wide...
>
> I essentially agree with Ewan. I'd call it mandatory that $@
> evaluates to TRUE upon an exception having been thrown. If this
> cannot be achieved, I suggest to rollback to the previous way of
> exception throwing.
>
> I'd actually suspect that 99% of bioperl users don't need an
> exception object. Remember that one of the main use cases of
> bioperl is scripting, not only ensembl-scale applications. If an
> exception occurs you just want to bail out with a nice message
> that aids debugging. The worst scenario is if the kind of
> exception throwing affects the bioperl learning curve in any
> (negative) way.
>
>
> 	-hilmar

-- 
========================================================================
Lincoln D. Stein                           Cold Spring Harbor Laboratory
lstein@cshl.org			                  Cold Spring Harbor, NY
========================================================================