Comment
Comment by fanf2
One weirdness I encountered recently with nested functions:
This is because named subroutines are created once and variable captures are resolved at that time. I expected the more normal capture semantics you get with anonymous subs, like