|
|
| Just another Perl shrine | |
| PerlMonks |
Re^3: What is method () ?by Roger_B (Scribe) |
| on Oct 06, 2005 at 08:44 UTC ( [id://497905]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
TheDamian's benefits relate to hashes scoped to the block that are used hold the attributes of instances to the class, making them properly declared and truly private.
The block is redundant in your code as no such variables exist, and your classes appear to be using the usual idiom of blessing an anonymous hash to store attributes, whereas TheDamian's code blesses an anonymous scalar so that this idiom can't be used. Roger_B
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||