When the while is written in this manner, each line that is processed is assigned to the default perl variable, $_ - When subsequent matching and printing is performed without specifying a variable or specific string to act upon, the use of the default variable $_ is assumed and it is this which is acted upon.
See the perlvar and perlop man pages for further detail.