in reply to Constant value in anonymous sub

It's called a closure. See perlref.