use warnings; use strict; my $organization = "thre"; my @orgs = qw (one two three four); error_suspect_org() if ! grep {$organization eq $_} @orgs; sub error_suspect_org { die "not a valid org!\n"; }