foreach $sub ( @sub_names ) { sub $sub { #subroutine implementation } }