in reply to does a hash element as a loop parameter cause significant slowdown?
for my $c (1..$n1) {
The list 1..$n1 is created in memory and then iterated over so $n1 is only evaluated once.
If you instead used a C style for loop then $n1 would be evaluated $n1 times.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: does a hash element as a loop parameter cause significant slowdown?
by LanX (Saint) on Sep 08, 2023 at 23:34 UTC | |
by pryrt (Abbot) on Sep 09, 2023 at 00:00 UTC | |
by LanX (Saint) on Sep 09, 2023 at 12:19 UTC |