processing reading the inputs stops when EOF is reached.
$line = <STDIN>;
The < > operator evaluates a filehandle, in this case the built-in filehandle STDIN, which in turn reads a line and returns it. $line contains its trailing newline, if it was present. If EOF is reached, the undefined value (undef) is returned. Perl treats undef as false when tested in a condition.