for my $item (@$data) { if (defined($$item{email}) and $$item{email} ne '') { good("Email found."); } else { bad("No email address."); next; } ...other stuff... }