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
In reply to Re^2: Next from inner loop only works "most of the time"
by jo37
in thread Next from inner loop only works "most of the time"
by Marshall
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |