[Bioperl-l] Grrrr. Another subtle overloading bug ...
Ewan Birney
birney@ebi.ac.uk
Thu, 10 Jan 2002 09:51:16 +0000 (GMT)
On Wed, 9 Jan 2002, Steve Chervitz wrote:
>
> My guess is that it won't work starting with 5.005,
> based on this note from the perl 5.005 delta docs:
>
> "die() now accepts a reference value, and $@ gets set
> to that value in exception traps. This makes it
> possible to propagate exception objects. This is an
> undocumented experimental feature."
>
> Anyway, I did some more digging and I'm pleased to
> report that I figured it out and there's a simple
> solution.
>
> Turns out that Error.pm overloads numeric operations
> to call Error::value(), and this is triggered by
> if($@). So if you didn't have a -value parameter when
> you created the Error object, Error::value() returns
> undef and if($@) fails.
>
> The simple fix is for Bio::Root::Root::throw() to
> check whether or not a -value parameter was supplied,
> and if not (as when calling throw('string')), create a
> non-zero dummy value before calling Error::throw().
> I've got a fix for this that I'll commit soon.
just noticed the commit. Very nice Steve!
>
> Steve
>
>
> __________________________________________________
> Do You Yahoo!?
> Send FREE video emails in Yahoo! Mail!
> http://promo.yahoo.com/videomail/
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
>
-----------------------------------------------------------------
Ewan Birney. Mobile: +44 (0)7970 151230, Work: +44 1223 494420
<birney@ebi.ac.uk>.
-----------------------------------------------------------------