sub fred { # meeting all three requirements:- my ($t, $u, $v, $w, $x, $y) = @_; somelogger( 5, "fred", "start of fred"); my $ok = method1($t); $ok &&= method2($u); my $pid = open my $ph, "/somewhere/program $v |"; my $output = ''; $ok &&= method3( <$ph>, \$output ); close $ph; waitpid $ph,0; # and so on for functionality using $w, $x and $y (in worst case scenario) # if goto were used to jump to the exit point the # label would have been here. if ($ok) { somelogger( 5, "fred", "fred completed successfully"); } else { somelogger( 5, "fred", "error during fred"); } return $ok; }