sleep while not false

produces an immediate return in my perl "v5.6.0 built for i386-linux" Debian. Replace "false" with zero or function call - and get correct behavior. Seems that perl itself hurries into a conclusion without getting the stated facts :) I'd file a bug report but I'm too lazy/sleepy now to find out where. Google did not recall instances of the same anyway.

Sometimes Perl hurts. Really.

/korpiq, perl@kato.iki.fi

Replies are listed 'Best First'.
Re (tilly) 1: Impatience: sleep while not false
by tilly (Archbishop) on Feb 12, 2001 at 10:28 UTC
    Either warnings or strict would have caught your mistake.

    In your case false is caught by the "poetry optimization" and interpreted as the string "false" which is not undef, '', or 0, and therefore is a true value.

use -w: "false" is true
by Anonymous Monk on Feb 12, 2001 at 10:24 UTC
    :) better sleep while this.tired.

    /korpiq, same