convenientstore has asked for the wisdom of the Perl Monks concerning the following question:
my @required = qw(preserver sunscreen water_bottle jacket); my @skipper = qw(blue_shirt hat jacket preserver sunscreen); for my $item (@required) { unless (grep $item eq $_, @skipper) { # not found in list? print "skipper is missing $item.\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: grep and $_
by grep (Monsignor) on Aug 11, 2007 at 23:26 UTC | |
by convenientstore (Pilgrim) on Aug 11, 2007 at 23:38 UTC | |
by mreece (Friar) on Aug 11, 2007 at 23:58 UTC | |
|
Re: grep and $_
by bruceb3 (Pilgrim) on Aug 11, 2007 at 23:24 UTC |