sub noop { 1; } my %funcs = ( apple => [\&apple_wash, \&apple_core, \&apple_pulp,], bananas => [\&banana_bend, \&banana_hang, \&noop,], ); ## . . . for my $i ( @items ) { unless( exists $funcs{ $type } ) { warn "Bad type `$type'\n"; next; } $_->( $item ) foreach( @{ $funcs{ $type } } ); }