in reply to Default variable within loops
Here another option using smart matching:
use Modern::Perl; my @a = 1 .. 10; my @b = 5 .. 14; say grep $_ ~~ @b, @a;
Output:
5678910Hope this helps!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Default variable within loops
by cheekuperl (Monk) on Jun 21, 2012 at 03:23 UTC | |
by Kenosis (Priest) on Jun 21, 2012 at 03:28 UTC |