in reply to Foreach loop
Use grep with ^ and $ to match exactly 1
Update:if (my ($matched) = grep /^1$/, @array) { print "found it: $matched\n"; }
Corrected the code as marked by Bloodnok
All is well
In Section
Seekers of Perl Wisdom
in reply to Foreach loop
Use grep with ^ and $ to match exactly 1
Update:if (my ($matched) = grep /^1$/, @array) { print "found it: $matched\n"; }
Corrected the code as marked by Bloodnok