sub xy { my $i = 0; for (qw/hier deine liste/) { #tu sonst was $i++; } return $i if($i < 5); }