my $ref = $self->{_words}; for (my $i = 0; $i < @$ref - 1; $i++) { my $temp = @$ref[$i]->pass_matches; my @curr_word = @$temp; foreach my $curr (@curr_word) { #blah blah blah } }