sub foo { print "Foo!\n"; } sub bar { print "Bar!\n"; } my %dispatch = ( foo => \&foo, bar => \&bar, ); for my $key (keys %dispatch) { print "$key ... "; &{$dispatch{$key}}; }