in reply to homework: Simple matching and sorting

For the first part of your assignment:
use strict; my $lastline; while (<DATA>) { $lastline = $_ if /;/; } print $lastline; __DATA__ This is not the right line This is OK, it contains a ; This is no good either Hey, a ; in this line! Drop this.
Of course you will want to change the <DATA> filehandle for some proper filehandle pointing to the text file.

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law