# Validate a data set ITEM: foreach my $item (@data) { foreach my $key (qw(foo bar baz)) { if (!exists $item->{$key}) { warn "Couldn't grok item. $key missing. Skipping.\n", Dumper($item); next ITEM; } } # Do something useful with this item. }