my $sub = \&{'do_'.$type}; die "Unknown sub 'do_$type'" unless defined(&$sub);