Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> Perl >> Snippet

Does an array contain an element


$is_there = grep $_ eq $whatever , @array ;     # why author didn't like it?
$is_there = grep /$whatever/, @array ;         # why author didn't like it?