Beginning Perl pp 131-152 | Cite as



When programming, naturally there are activities we want to do again and again: adding up the values in an array, stripping extraneous blank spaces from a string, getting information into a hash in a particular format, and so on. It would be tedious to write out the code for each of these little processes every time we need to use it, and maintaining each code segment would be horrific: if there’s a bug in the way we’ve coded the activity, we have to go through and find it each time and fix it. Wouldn’t it be better if we could define a particular process just once, and then be able to call on it whenever we need to, just like we call on Perl’s built-in functions?


Global Variable Return Statement Main Program Area Code Function Argument 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© James Lee 2010

Personalised recommendations