my %todo = ( 1023 => "d f g still fails, but it's not that important", 1567 => 'yikes, we need to fix this one!', ); foreach my $foo (@foo) { foreach my $bar (@bar) { foreach my $car (@car) { todo_some( \%todo,\&ok,func($foo,$bar,$car),"check result of function" ); } } } #### =head2 todo_some Execute given test subroutine while setting $TODO flag for given test numbers. IN: 1 hash reference, with testnumber / reason strings pairs 2 reference to subroutine to execute test 3..N parameters to pass to test subroutine OUT: 1 whatever test sub returns =cut my $Test = Test::Builder->new; # so we don't need to do it over and over again sub todo_some { local $TODO = shift->{$Test->current_test + 1} || ''; no strict 'subs'; my $sub = shift; $sub->( @_ ); } #todo_some