http://www.perlmonks.org?node_id=992132


in reply to weird begginer's problem...

You start with $w == 0. You post-increment it, which means before changing its value, you perform the || die test. Therefore, 0 || die goes the "or" way and dies. Since there was no system failure immediately before the death, the value of $! is meaningless, as documented in Perl Predefined Variables / $OS_ERROR.
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ