Chapter 7. Working with Functions
Functions are at the heart of a well-organized script, and will make your code easy to read and reuse. No large project would be manageable without them, as the problem of repetitive code would bog down the development process. Throughout this chapter, we will investigate functions and demonstrate some of the ways in which they can save you from repetitive work. In this chapter, you will learn
How to define and call functions from within your scripts
How to pass values to functions and receive values in return
How to call a function dynamically using a string stored in a variable
How to access global variables from within a function
How to give a function a “memory”
How to pass data to functions by reference
How to create ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access