Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- PERL 4.0 Reference Guide - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

     grep(EXPR,LIST)

             Evaluates EXPR for each  element  of  LIST  (locally
             setting  $_  to  each element) and returns the array
             value consisting of those  elements  for  which  the
             expression  evaluated to true.  In a scalar context,
             returns the number of times the expression was true.

                  @foo = grep(!/^#/, @bar);    # weed out comments

             Note that, since $_ is a reference  into  the  array
             value,  it can be used to modify the elements of the
             array.  While this is useful and supported,  it  can
             cause  bizarre  results  if  the LIST is not a named
             array.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson