use strict; use warnings; my %allNames; while () { chomp; $allNames{$_} = 1; } for my $testName ("John Lennon", "Raubtier", "Paule McC") { print "$testName ist " . ($allNames{$testName} ? "" : "nicht ") . "drin\n"; } __DATA__ John Lennon Paule McC