4.4. Miscellaneous

4.4.1. Autovivification

You wouldn't ordinarily expect to alter the value of something just by looking at it. So when that happens (even if for very good reasons), it's worth drawing attention to it so you can look out for it.

Autovivification is an expensive Perl term that you can impress your friends with. It means that certain variables get created for you if necessary. Perl has extremely friendly syntax for creating multidimensional data structures. For instance, let's say you're populating the hash %state_info from section 4.1.3; you have first-level keys that are state abbreviations and second-level keys that are names of state attributes, one of which names the largest cities. You can insert the entry for those cities ...

Get Perl Debugged now with O’Reilly online learning.

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