my $i; foreach $i (0 .. $#mit2) { last if $mit2[$i] eq $rname; } splice @mit2, $i;