my @problems = (1,2,3); for my $i (0 .. $#problems) { push @problems, $problems[$i] if $problems[$i]; } print for @problems; ####