my %choice = ( 1 => 'stuff', 2 => 'more stuff', ... ); print $choice{$input}, "\n"; # hey, let's make functions now! my %choice = ( 1 => \&stuff, 2 => \&more_stuff, ... ); &{$choice{$input}};