A.9 Answer for Chapter 10A.9.1 Exercise (Section 10.7.1)First, start the class: { package RaceHorse;Next, use a simple dbmopen to associate %STANDINGS with permanent storage: dbmopen (our %STANDINGS, "standings", 0666) When a new RaceHorse is named, either pull the existing standings from the database or invent zeroes for everything: sub named { # class methodWhen the RaceHorse is destroyed, the standings are updated: sub DESTROY { # instance method, automatically invokedFinally, the instance methods are defined: ## instance methods: |
•
Table of Contents
•
Index
•
Reviews
•
Reader Reviews
•
Errata
Learning Perl Objects, References & Modules
By
Randal L. Schwartz