juo has asked for the wisdom of the Perl Monks concerning the following question:
When looking for a match in a pattern I always used the grep function, however using this function has the limitation that it does not look for an exact match but rather for a pattern match. If I look for ACB and I have in my array ACBD it will match it while I don't want it to be matched. Anybody has a good idea on this without changhing to much of the routine as I like it that short.
if (not grep($_ eq $machine_sheetname,@sheets)) { push @sheets,$machine_sheetname; $skip = 0; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Looking for exact match in an array
by saintmike (Vicar) on Dec 10, 2004 at 06:01 UTC | |
Re: Looking for exact match in an array
by gaal (Parson) on Dec 10, 2004 at 06:25 UTC | |
by revdiablo (Prior) on Dec 10, 2004 at 17:36 UTC | |
by gaal (Parson) on Dec 10, 2004 at 20:35 UTC | |
Re: Looking for exact match in an array
by pg (Canon) on Dec 10, 2004 at 05:56 UTC |