in reply to Is list member
#!/usr/bin/perl -w # # quick test to match an item in an array use strict; my $match = shift ; my @arr = qw( 2 3 4 5 6 7 foo foo12 12foo 1foo1) ; print "match \n" if ( grep(/\b$match\b/, @arr) ) ;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Grep ?..
by demerphq (Chancellor) on May 06, 2002 at 17:16 UTC |