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 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.