my $found = 0; ... if ($found == 0){... # or better: if (! $found){... # or for truth: if ($found){... #### 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"; }