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

Aaron J Mackey Aaron J. Mackey" <amackey@virginia.edu
Sun, 6 Jan 2002 18:59:11 -0500 (EST)


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:

$@ 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