in reply to Why my variable is not 0 ?

As documented in perlop:
Perl operators that return true or false generally return values that can be safely used as numbers. For example, the relational operators in this section and the equality operators in the next one return 1 for true and a special version of the defined empty string, "", which counts as a zero but is exempt from warnings about improper numeric conversions, just as "0 but true" is.

Update: Here's the difference:

use Devel::Peek; my $f = (0 != 0); my $e = q(); Dump($f); Dump($e);
SV = PVNV(0x60003a5a0) at 0x600077cc8 REFCNT = 1 FLAGS = (IOK,NOK,POK,pIOK,pNOK,pPOK) IV = 0 NV = 0 PV = 0x6000b60c0 ""\0 CUR = 0 LEN = 10 SV = PV(0x60003c250) at 0x600077d70 REFCNT = 1 FLAGS = (POK,IsCOW,pPOK) PV = 0x60009a810 ""\0 CUR = 0 LEN = 10 COW_REFCNT = 1
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^2: Why my variable is not 0 ?
by pcouderc (Monk) on Jan 08, 2016 at 15:09 UTC
    Thank you all.
    It is more clear to me.
    My conclusion is that false is not always 0...
    But it is not a problem to take care of.

      Hello pcouderc,

      My conclusion is that false is not always 0...

      No, indeed. The definition of false in Perl is given in perlsyn#Truth-and-Falsehood:

      The number 0, the strings '0' and "", the empty list (), and undef are all false in a boolean context. All other values are true. Negation of a true value by ! or not returns a special false value. When evaluated as a string it is treated as "", but as a number, it is treated as 0. Most Perl operators that return true or false behave this way.

      Hope that helps,

      Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

        Yes, it does... Thank you !