good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: error message in the end of the array looping?by ioannis (Abbot) |
on May 31, 2006 at 09:19 UTC ( [id://552728]=note: print w/replies, xml ) | Need Help?? |
Use the first() function from List:Util .
print +(first { $_ eq 'correct_value' } @arr) || 'not found';
In Section
Seekers of Perl Wisdom
|
|