in reply to Two regex problems (easy)

$line =~ m/\s+([a-zA-Z0-9])$/;

The char class needs to be quantified:

$line =~ m/\s+([a-zA-Z0-9]+)$/;

or

$line =~ m/\s(\w+)$/;

For the second problem (or better for both) use split.

(Update: added more newlines)