Chapter 11. Subroutines and variable scoping

11.1

Compartmentalizing code with subroutines

363

11.2

Common problems with variables

370

11.3

Controlling variable scoping

373

11.4

Variable Scoping Guidelines for complex programs

376

11.5

Reusing a subroutine

386

11.6

Summary

387

Thinking logically may come naturally to Vulcans like Star Trek’s Mr. Spock, but it’s a challenge for most earthlings. That’s what those millions of VCRs and microwave-ovens blinking 12:00 ... 12:00 ... 12:00—since the 1980s—have been trying to tell us.

What’s more, even those who excel in logical thinking can experience drastic degradations in performance when subjected to time pressures, sleep deprivation, frequent interruptions, tantalizing daydreams, or problems at home—i.e., under normal ...

Get Minimal Perl 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.