DEFECT: foreach my $defect ( @$list ){ # $summary is my pseudo object, # this line converts each defect line into a hash # whose keys are the attributes desired to be selected my $line = parseLine( $summary, $defect ); if ( ! $line ){ next DEFECT }; # i create a filtered list in the $summary hash my $rule = match_rule( $line ); if ( defined $rule ) { push @{$summary->{FILTEREDLIST}->{$rule}}, $defect; } }