in reply to if else statement check an array

While all the answers I've seen to your post are well done and right to the point, I wonder whether they really so helpful for you, because they seem to be missing what I think might be your main problem:

From the way you ask your question, I assume that you are not a programmer, i.e. have never taken an introductory class in programming. I conclude this because your question is not so much Perl-specific, but an elementary problem in program in general: How can I find out whether or not a predicate holds for every member in a set of data.

If my guess is correct (and I know that it happens all the time that someone who has never really learned to program, is suddenly given one day the task of programming something), then I can only recommend that you first spend one or two weeks just to learn the principles of programming before trying your skills on a new project. There are a lot of introductory books around (although I don't know one which is teaching Perl as the first programming language - but maybe some fellow monks can help out here).

Actually I did find an introductory book online, though it is for Python, not for Perl: http://openbookproject.net//thinkCSpy/. In case you don't find anything suitable for Perl, you might also try this one first; once you've learned a few principles of programming, it is not too difficult to switch to a different language.

-- 
Ronald Fischer <ynnor@mm.st>