in reply to Simple Regex Question

Please, read the perlre man page, as well as pick up a copy of Mastering Regular Expressions.

This should do what you want..

while (my $line = <CONFIG>) { chomp $line; if ((split /\s+/,$line)[2] =~ /(\w+)-/i) { print $1; } }

Cheers,
KM