in reply to Re: Next from inner loop only works "most of the time"
in thread Next from inner loop only works "most of the time"
I don't think the multiple usage of $_ is problematic here. According to perlsyn the global $_ gets localized in a foreach loop. Indeed:
#!/usr/bin/perl use v5.16; use warnings; foreach (1, 2) { say for qw(a b); say; foreach (10, 20) { say; } say; } __DATA__ a b 1 10 20 1 a b 2 10 20 2
Greetings,
-jo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Next from inner loop only works "most of the time"
by tobyink (Canon) on May 18, 2021 at 19:07 UTC | |
by GrandFather (Saint) on May 18, 2021 at 22:01 UTC | |
|
Re^3: Next from inner loop only works "most of the time"
by Anonymous Monk on May 18, 2021 at 23:52 UTC |