in reply to Re^3: Access a global variable from a subroutine when used as "for" iterator
in thread Access a global variable from a subroutine when used as "for" iterator
my @array = (1, 2, 3, 4, 5); my $count = (1, 2, 3, 4, 5); say "$count: @array";
That's very confusing. It breaks two rules:
The correct example should have been
my @array = (11, 12, 13, 14, 15); my $last = (11, 12, 13, 14, 15); my $count = @array; say "$last, $count, @array";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Access a global variable from a subroutine when used as "for" iterator
by LanX (Saint) on Dec 22, 2023 at 17:53 UTC | |
by choroba (Cardinal) on Dec 22, 2023 at 18:11 UTC | |
by LanX (Saint) on Dec 23, 2023 at 02:02 UTC |