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

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


So does $@ contain an overloaded reference?  I can't think of any other way 
that this could happen!

Lincoln

On Monday 07 January 2002 05:18, Ewan Birney wrote:
> On Sun, 6 Jan 2002, Aaron J Mackey wrote:
> > On Sun, 6 Jan 2002, Ewan Birney wrote:
> > >   if( $@ ) triggers the "stringify" method, which gives back a nice
> > > piece of text and then gets evaluated as a number (I think...), which
> > > goes to 0 which evaluates as .... FALSE.
> >
> > Since when would any non-empty/non - "0 but true"/non-numeric string
> > not be true in a boolean context?  Here's the cases I can see where a
> > string would return false:
>
> This is definitely what happens!
>
>   if( $@ =~ /EX/ )  # returns true
>   if( $@ ) # returns false
>
>
> I don't understand it fully either, but that is definitely what is
> happening...
>
> > $@ eq "0";
> > $@ eq ""
> > !defined($@) ; # already said that's not the case
> >
> > The only way you'd get what you describe is in constructs like:
> >
> > if ( $@ != 0 ) { # force numeric context on $@
> >
> > -Aaron
>
> -----------------------------------------------------------------
> Ewan Birney. Mobile: +44 (0)7970 151230, Work: +44 1223 494420
> <birney@ebi.ac.uk>.
> -----------------------------------------------------------------
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l

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