For the sake of generality. In the full code (not shown) I have 4 different types of commands I need to spawn. If I didn't have the forking as a subroutine I would have to repeat most of the subroutine code 4 different times, making the code longer, and more difficult to modify (eg if I needed to change code in one of the forking sections I probably would need to change it in the 3 others).