cvs commit: perlfaq perlfaq4.pod
[email protected] (brian d foy) 14 Oct 2005 15:34:07 -0000
| Newsgroups | perl.cvs.perlfaq |
|---|---|
| Message-ID | <[email protected]> |
cvsuser 05/10/14 08:34:06 Modified: . perlfaq4.pod Log: fixed two minor typoes Revision Changes Path 1.69 +3 -3 perlfaq/perlfaq4.pod Index: perlfaq4.pod =================================================================== RCS file: /cvs/public/perlfaq/perlfaq4.pod,v retrieving revision 1.68 retrieving revision 1.69 diff -u -r1.68 -r1.69 --- perlfaq4.pod 13 Oct 2005 19:43:13 -0000 1.68 +++ perlfaq4.pod 14 Oct 2005 15:34:06 -0000 1.69 @@ -1212,7 +1212,7 @@ =head2 How can I tell whether a certain element is contained in a list or array? -(portions of this answer contributed by Annoo Siegel) +(portions of this answer contributed by Anno Siegel) Hearing the word "in" is an I<in>dication that you probably should have used a hash, not a list or array, to store your data. Hashes are @@ -1266,7 +1266,7 @@ undef; } -If speed is of little concern, the common idiom use grep in scalar context +If speed is of little concern, the common idiom uses grep in scalar context (which returns the number of items that passed its condition) to traverse the entire list. This does have the benefit of telling you how many matches it found, though.