Readd chapter 3

You could have avoided the need for a defined check by doing a standard while loop, something like while ( my $input = <STDIN> ) {...