(Defined execution order left as exercise for the reader)use feature ":5.10"; my %hash = map { $_ => state $i++ } qw(red blue green yellow black whi +te purple brown orange gray); for (1..2) { while (($k,$v) = each %hash) { do_something_with($k, $v); } }
In reply to Re: Interesting Use for "state" Variables
by Beechbone
in thread Interesting Use for "state" Variables
by liverpole
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |