Organization of Subroutines
A solid programming strategy is to write programs in small, manageable, reusable pieces. This division of labor in Perl is accomplished through the use of programmer-written subroutines, operating system calls, built-in subroutines, and library functions. To the Perl programmer, they all look the same. Part 1 of this book concentrates on programmer-written subroutines.
Although programmer-written subroutines may be defined anywhere within a Perl script, in practice they are usually defined in separate files and then imported into any program that needs them. However, for simplicity, the first few subroutines that we demonstrate will be defined at the top of the file that needs them. The general form of a subroutine ...
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