should it be a regex?
you can use a hash to hold the data and check if an element has occured more than once.If you need exactly two, try thismy %temp; my @captured = grep { defined $temp{$_}++ } split / /, <DATA>;
my %temp; my @captured = grep { ++$temp{$_} == 2 } split / /, <DATA>;
In reply to Re: Red Nex Needed
by Chady
in thread Reg Ex Needed
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |