It's called a closure. See perlref.
In reply to Re: Constant value in anonymous sub by almut in thread Constant value in anonymous sub by Sewi