in reply to Re: Why does this hash remove duplicate lines
in thread Why does this hash remove duplicate lines

Undefined values are false, and 1 or higher are determined to be true values in boolean context.

Undefined values, 0, and the empty string are false. Everything else is true in boolean context -- even negative numbers.

  • Comment on Re^2: Why does this hash remove duplicate lines

Replies are listed 'Best First'.
Re^3: Why does this hash remove duplicate lines
by mr_mischief (Monsignor) on Mar 06, 2008 at 17:19 UTC
    Yes, that's true. Negative numbers happen to be irrelevant to the example, which is the reason I didn't mention them. The clarification may help, but I didn't see that as the OP's source of misunderstanding the example.