sub getProc { #do some stuff } sub getInput { while() { # do some stuff # call getProc but run it in the background }