in reply to help with split()

Context, context, context. split returns an array. When an array is put into scalar context, it gives the number of elements in the array, not the first value.
while (<FILE>) { ($class) = split /\s+/, $_; print $class, $/; }

It will discard all the other elements.

As an aside, check out strict and warnings. They'll help save your life sometime.

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.