> I boiled the problem down to this code
Here you are initializing a seperate variable before the until, which is getting reset by the my inside the until. In my code I was initializing the variable inside the until, and then attempting to use it after. Seems like two different (but related) bugs to me.
> PS: I have problem to imagine practical code, where this bug is posing a problem.
My original code:
$count++ until my %boxes = fit($count, $quota, @sizes);
I wasn't sure about the scope when I wrote that line, but figured worst case I would get a compile error and move the my to the line above. Had a hell of a time figuring out why %boxes was always null when I tried to access it later (it should loop until %boxes is not null).