ag4ve has asked for the wisdom of the Perl Monks concerning the following question:
% perl -MData::Dumper -e 'my $i = ""; my @arr = qw/fe fi fo fum/; my +@p = grep { ! /$i/ } @arr; print Dumper(@p);' % perl -MData::Dumper -e 'my $i = " "; my @arr = qw/fe fi fo fum/; my + @p = grep { ! /$i/ } @arr; print Dumper(@p);' $VAR1 = 'fe'; $VAR2 = 'fi'; $VAR3 = 'fo'; $VAR4 = 'fum';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Match nothing in grep { ! // }
by choroba (Cardinal) on Mar 14, 2013 at 09:43 UTC | |
|
Re: Match nothing in grep { ! // }
by Anonymous Monk on Mar 14, 2013 at 06:38 UTC | |
by bart (Canon) on Mar 14, 2013 at 12:07 UTC | |
by ag4ve (Monk) on Mar 14, 2013 at 08:20 UTC | |
by McA (Priest) on Mar 14, 2013 at 09:21 UTC | |
by Anonymous Monk on Mar 14, 2013 at 09:58 UTC | |
|
Re: Match nothing in grep { ! // }
by McA (Priest) on Mar 14, 2013 at 06:28 UTC |