readline() on closed filehandle in Perl

In a Perl program all kinds of things can go wrong and if you don't use warnings
then you might not even know about it.

Take this examples that has a programming mistake.
Perl would generate a readline() on closed filehandle warning if warnings were enabled
helping you locate the problem, but it would silently and probably incorrectly(!) work without the
warnings.