How can I check if a Perl array contains a particular value?
Best general purpose – Especially short arrays (1000 items or less) and coders that are unsure of what optimizations best suit their needs. # $value can be any regex. be safe if ( grep( /^$value$/, @array ) ) { print “found it”; } It has been mentioned that grep passes through all values even if … Read more