# off-hand untried code PROGRAM_INIT: my %proc_table = ( type => \&process, apple => \&apple_wash_core_pulp, banana => \&banana_bend_hang, ); foreach ( @item){ &$proc_table{$type} if exists $proc_table{$type}; next; unknown_type(); }