my $condNum = 0; for $condNum ( 1 .. 10 ) { forceSituation( $conditions[condNum] ); my $result = measureSituation(); push @results, $result; last if $result->is_error(); more_manipulation(); # possibly do more stuff for this condition, but only if it's not an error } datalog( value => $condNum, llim => 9.9, hlim => 10.1, name => 'number of situations tested' ); datalog( value => fn(@results), llim => -2.7182818, hlim => 3.1415926, name => 'result of those situations' )