if ($email_address eq 'first.last@example.com') { # OK - process normally } else { # Possibly not OK - phishing check } #### my %valid_email_for = ( 'Display Name' => { 'first.last@example.com' => 1, 'first.last@example.net' => 1, 'first.last@example.org' => 1, }, ); ... if (exists $valid_email_for{$displayname}{$email_address}) { # OK - process normally } else { # Possibly not OK - phishing check }