Part 4 of the Perl assignment.