Learning Perl Objects, References amp;amp; Modules [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Learning Perl Objects, References amp;amp; Modules [Electronic resources] - نسخه متنی

Randal L. Schwartz

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید














10.7 Exercise


The answers for all exercises can be found in Section A.9.


10.7.1 Exercise [45 min]


Modify the RaceHorse class to get the previous
standings from a DBM hash (keyed by the horse's
name) when the horse is created, and update the standings when the
horse is destroyed. For example, running this program four times:

my $runner = RaceHorse->named("Billy Boy");
$runner->won;
print $runner->name, " has standings ", $runner->standings, ".\n";

should show four additional wins. Make sure that a
RaceHorse still does everything a normal
Horse does otherwise.

For simplicity, use four space-separated integers for the value in
the DBM hash.



/ 199