Going Deeper

Subroutines are fairly basic concepts that don't involve a large amount of depth in Perl. Nonetheless, there are a few concepts that aren't discussed in this lesson, which are summarized here.

The definitive description of Perl subroutines, because my is an operator, more information about it can also be found in the perlfunc man pages (although we'll also talk more about it on Day 13). See those pages for further details on any of the concepts described in this section.

Local Variables in Blocks

I've made a point of referring to local variables in this section as being defined inside subroutines, and local only as far as those subroutines are running. In reality, local variables can be defined to be local to any enclosing block, ...

Get Sams Teach Yourself Perl in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.