I'm late coming in with this, sorry:(
If while (<STDIN>) does something you don't expect, the Perl documentation should be your first port of call. You can...
- google for perldoc while
- search for while at http://perldoc.perl.org
- Use perldoc perlsyn from the command line (unfortunately you need to know that while's described in perlsyn)
- If you're using ActivePerl on windows, Perl's documentation can be accessed via Start -> Programs -> ActivePerl -> Documentation.