package Employee; . . . sub apply_effect { my ($self, $effects) = @_; # $effects->list returns a list of objects containing # the singular effects foreach my $effect ( $effects->list ) { my $attribute = $effect->attribute; throw_exception() unless exists $self->{$attribute}; # Rest of code } }