while (my $file = get_email_file()) { for my $email (get_possible_original_recipients($file)) { if ($in_test{$email}) { # Do something here. } } }