in reply to Validate array of numbers in sequence

Your solution for the problem is fine, I think. But I have two remarks on the code:
You check twice for the "1" at index 0.
Your loop is somewhat complicated. Try something like:
my $index = 1; foreach my $number (@numlist) { unless ($index == $number) { print "..."; last; } $index ++; }
daniel.