for my $item (@$data) { if (!defined($item->{email}) || $item->{email} eq '') { bad("No email address."); next; } good("Email found."); ...other stuff... }