in reply to Saltine::Toffee
From what little I have understood about objects, the word new isn't some sort of magic word that has to be used. So, to avoid people running to the store to buy a new Oven, Saucepan, and Cookie::Sheet, why not have the following?
my $oven = Oven->empty() or die "What did you scorch last?"; my $pan = Saucepan->clean() or die "Wash the pan."; my $sheet = Cookie::Sheet->clean() or die "Wash the cookie sheet.";
If I ever understand objects, I think I will use clear or fresh instead of new just for fun. In the above, empty and clean are more descriptive of the state of the object in my ever so humble opinion.
Updated: added dies.
|
|---|