Functions let you break up your code into manageable chunks, which is great for limiting the scope of possible conflicts between variables. You can pass data to functions and have functions return values as well. The whole idea here is to compartmentalize what's going on in your scripts so that you're dealing with only a dozen or so lines of code at a time instead of thousands. Here's a summary of the salient points in this chapter:
|