Something like this sub jump # this is basically all psuedocode the real sub is more complicated but this is the gist { if($condition == TRUE) { $jmptaken = 1; } else { $jmptaken = 0; } } sub loopstuff { do { &DoAllTheThing!!(); #since the loop/jmp is pushed to the array anyway, it will be run in the &doallthethings }until($jmptaken == 0) }