in reply to Re: Grep Pattern
in thread Grep Pattern
That's the approach I would recommend as well. But you kinda messed up on the implementation.
my @pat = ( 0, 1, 1, 0 ); my @result = grep { $pat[ $_ % @pat ] } 0..12;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Grep Pattern
by LanX (Saint) on Dec 12, 2018 at 16:43 UTC | |
by hdb (Monsignor) on Dec 13, 2018 at 08:29 UTC | |
by ikegami (Patriarch) on Dec 13, 2018 at 18:25 UTC | |
by LanX (Saint) on Dec 14, 2018 at 12:29 UTC | |
by ikegami (Patriarch) on Dec 14, 2018 at 17:06 UTC | |
by LanX (Saint) on Dec 14, 2018 at 17:25 UTC | |
| |
Re^3: Grep Pattern
by Aldebaran (Curate) on Dec 15, 2018 at 00:38 UTC | |
by LanX (Saint) on Dec 15, 2018 at 01:36 UTC | |
by ikegami (Patriarch) on Dec 15, 2018 at 15:48 UTC |
In Section
Seekers of Perl Wisdom