|Just another Perl shrine|
Check if at least one element of array is bigger than Xby Anonymous Monk
|on Apr 07, 2010 at 23:41 UTC||Need Help??|
Anonymous Monk has asked for the
wisdom of the Perl Monks concerning the following question:
lets say you have an array:
and you want to check if at least one element is bigger than 10.
Is there a way to do it in a loop, like:
and print the success message only once? I mean, I want to print something like :"Yes, at least one is bigger than 10", but not print it 4 times (since 4 of my numbers are bigger than 10.
It must be something silly that I can't think about, but I'm new to Perl and don't know much yet...