our $cookingcounter = 350883; our $garlicbreadheadstart = 600; our $ovenempty = 0; sub hold_time { my $cookingcounter = shift; return 0 if $ovenempty and !$test; my $holdtime = $cookingcounter + 60*90 - 356400; return $holdtime if $holdtime > 0; $holdtime = $cookingcounter + ($garlicbreadstart - 60 * (60+15)) - 356400; return $holdtime if $holdtime > 0; return 0; }