5 print grep("$foo", @list);
6 print ( grep "$foo", @list );
7 @list = ( grep "$foo", @list );
8 $aref = [ grep "$foo", @list ];
9 $href = { grep "$foo", @list };
11 if( grep { foo($_) } @list ) {}
12 for( grep { foo($_) } @list ) {}
14 #-----------------------------------------------------------------------------
22 grep { foo($_) } @list;
23 grep({ foo($_) } @list);
25 if( $condition ){ grep { foo($_) } @list }
26 while( $condition ){ grep { foo($_) } @list }
27 for( @list ){ grep { foo($_) } @list }
29 #-----------------------------------------------------------------------------
31 ## name Comma operator
33 ## TODO not handled properly
36 $baz, grep "$foo", @list;
38 #-----------------------------------------------------------------------------
40 ## name Chained void grep
47 grep { baz($_) } @list;
49 #-----------------------------------------------------------------------------
51 ##############################################################################
52 # $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/Perl-Critic/t/BuiltinFunctions/ProhibitVoidGrep.run $
53 # $Date: 2008-03-16 17:40:45 -0500 (Sun, 16 Mar 2008) $
54 # $Author: clonezone $
56 ##############################################################################
60 # cperl-indent-level: 4
62 # indent-tabs-mode: nil
63 # c-indentation-style: bsd
65 # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :