in reply to Stuck Value

Assuming @data is the array you want to check for 5 indentical (string) values in a row:
my $c = 0; for (my $i = 1; $i < @data; $i ++) { if ($data[$i] eq $data[$i - 1]) { if (++$c >= 4) { print "Five indentical values in a row, starting at positi +on ", $i - 4, "\n"; } } else { $c = 0; } }