Hi. I have a general question about programming. I am wondering when to break things into subroutines and how to recognize when it would be good to do that. Generally I find that I cannot figure this out and my programming becomes very messy and the means to proceed is not clear. I don't know how to think about structuring the program. It seems that for my (very basic) programs that there will be one routine which will call another routine. There is also the problem of passing a value to the second routine. I have learned that this could be done by calling the second routine with arguments from the first routine (this is possible because the second routine is called from within the first routine) and then using shift; to catch the values of the argument.
Still I am not sure about these kinds of issues. Are there any good references or pointers on this?