use closure for Perl 5.8