in reply to iterating through array and saving matches to new array
And the nice benefit of grep is that it works with multiple arrays:
my @b = 1..1000; my @c = 900..1000; my @d = 910..1000; my @newb = grep {$_>850}(@b&&@c&&@d);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: iterating through array and saving matches to new array
by choroba (Cardinal) on Apr 15, 2018 at 21:46 UTC | |
|
Re^2: iterating through array and saving matches to new array (updated)
by AnomalousMonk (Archbishop) on Apr 15, 2018 at 21:41 UTC | |
|
Re^2: iterating through array and saving matches to new array
by Marshall (Canon) on Apr 19, 2018 at 19:56 UTC | |
by AnomalousMonk (Archbishop) on Apr 19, 2018 at 21:32 UTC | |
by Marshall (Canon) on Apr 19, 2018 at 23:05 UTC | |
by AnomalousMonk (Archbishop) on Apr 20, 2018 at 01:29 UTC | |
by Marshall (Canon) on Apr 20, 2018 at 02:56 UTC | |
|