my $sub = $_->{subroutine}; my $name = $_->{name}; $cron->add_entry( $_->{timespec}, sub { $sub->($name) } );