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: For UNIX and Linux People now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.