$step_1 = 0; $step_2 = 0; $step_3 = 0; $working = 1; while( $working ) { eval { $step_1 || first(); $step_2 || second(); $step_3 || third(); clean_up(); }; if( $@ ) { print STDERR $@; } else { $working = 0; } }