O'Reilly logo

Perl by Example, Fourth Edition by Ellie Quigley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 11. How Do Subroutines Function?

How Do Subroutines Function?

Subroutines/Functions

In addition to the large number of Perl functions already available, you can create your own functions or subroutines. Some languages distinguish between the terms function and subroutine. Perl doesn’t. If you say “subroutine,” everyone will know you are talking about a “function,” and if you say “function,” everyone will know you are talking about a “subroutine.”[1] Technically, a function is a block of code that returns a value, whereas a subroutine is a block of code that performs some task, but doesn’t return anything. Perl subroutines and functions can do both, so we’ll use the two ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required