in reply to Re^3: Minimisation of codes (if grep {})
in thread Minimisation of codes (if grep {})
#!/usr/bin/perl use Modern::Perl; use List::Util qw(first max maxstr min minstr reduce shuffle sum); my @pantry = ("Panc", "Pancake", "Panmix"); my $total = 0; $total++ if( any { Panc } @pantry); #$total++ if grep { /^\Qpanc\E$/ } @pantry; print "$total";
Here its showing error. Cant use Barewords Panc at 9
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Minimisation of codes (if grep {})
by choroba (Cardinal) on Oct 01, 2015 at 11:28 UTC | |
by ravi45722 (Pilgrim) on Oct 01, 2015 at 12:10 UTC | |
by choroba (Cardinal) on Oct 01, 2015 at 12:14 UTC | |
by ravi45722 (Pilgrim) on Oct 01, 2015 at 12:28 UTC | |
by MidLifeXis (Monsignor) on Oct 01, 2015 at 14:09 UTC |