Abstract
When programming, there will naturally be activities we will 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 one, and maintaining each code segment would be horrific: if there’s a bug in the way we’ve coded the activity, we’ll have to go through and find each one of them and fix it. It would be better if we could define a particular process just once, and then be able to call on that just like we’ve been calling on Perl’s built-in functions.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
Rights and permissions
Copyright information
© 2004 James Lee, Simon Cozens, Peter Wainwright
About this chapter
Cite this chapter
Lee, J., Cozens, S., Wainwright, P. (2004). Subroutines/Functions. In: Beginning Perl. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-0665-1_6
Download citation
DOI: https://doi.org/10.1007/978-1-4302-0665-1_6
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-59059-391-2
Online ISBN: 978-1-4302-0665-1
eBook Packages: Springer Book Archive