Truthiness is also discussed in Truth and Falsehood in perlsyn. As has been pointed out by others, you were testing "0\n" in the while-loop conditional and not the truly false string "0".
Update: At last, I see the point first made by LanX here: even if <STDIN> managed to return a plain, nominally false "0" character, the loop would still execute because "0" is defined and the special-case while-loop is conditional upon defined-ness! Thanks to BillKSmith (here) and LanX (here) for helping the scales to fall from my eyes.
Give a man a fish: <%-{-{-{-<
In reply to Re: truth in while condition (updated)
by AnomalousMonk
in thread truth in while condition
by TISON
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |