in reply to Re: Why does each() always re-evaluate its argument? (Updated x2 - experimental "for_list" )
in thread Why does each() always re-evaluate its argument?
> You may rather want to take a look at this newer (5.36 experimental) syntax: use experimental "for_list";
Just an FYI, in Re^7: Rosetta Code: Long List is Long (Updated Solutions - short Perl GRT and for_list), I excitedly changed one line from:
to:while (my ($k, $v) = each %{$href}) { push @lines, pack('NA*', -$v, "$ +k\t$v") }
for my ($k, $v) (%{$href}) { push @lines, pack('NA*', -$v, "$k\t$v") }
and it produced the identical result ... but, sadly, did not run appreciably faster.
👁️🍾👍🦟
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Why does each() always re-evaluate its argument? (Updated x2 - experimental "for_list" )
by LanX (Saint) on Dec 07, 2023 at 01:46 UTC | |
by ikegami (Patriarch) on Dec 07, 2023 at 01:58 UTC | |
by LanX (Saint) on Dec 07, 2023 at 02:49 UTC | |
by ikegami (Patriarch) on Dec 07, 2023 at 20:11 UTC | |
by LanX (Saint) on Dec 07, 2023 at 20:20 UTC | |
|