sub find_stuff { my $self = shift; scalar keys %$self; while (my $k = each %$self) { return $k if ($self->{$k}->{blablah}); } return undef; }