if ($punter eq 'coffee') { $drink = 'non alky'; } elsif ($punter eq 'beer' ) { $drink = 'alky'; } elsif ($punter eq 'whisky') { $drink = 'proper alky'; } else { $drink = 'unknown'; } #### my %lookup = ( 'coffee' => 'non alky', 'beer' => 'alky', 'whisky' => 'proper alky', ); if (exists $lookup{$punter}) { $drink = $lookup{$punter}; } else { $drink = 'unknown'; }