in reply to Reg Ex Needed

should it be a regex?

you can use a hash to hold the data and check if an element has occured more than once.
my %temp; my @captured = grep { defined $temp{$_}++ } split / /, <DATA>;
If you need exactly two, try this
my %temp; my @captured = grep { ++$temp{$_} == 2 } split / /, <DATA>;

He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

Chady | http://chady.net/