![]() |
|
Perl Monk, Perl Meditation | |
PerlMonks |
Re: Confused by OO & tieby davido (Cardinal) |
on May 17, 2004 at 15:58 UTC ( #354016=note: print w/replies, xml ) | Need Help?? |
tie, and perltie are two docs that discuss how to tie variables to objects. But think of it exactly that way; you have an object that you're tieing a variable to.
That means that Object Oriented Programming doesn't necessarily mean using tie. tie is just one use of OO. While tieing variables and filehandles can be a pretty neat trick, it doesn't necessarily lend itself to readability. Most people seeing $var = 10; expect it to do just that; assign ten to the variable $var. With tie, it could actually mean print "Fooled you! Ha!\n";. So keep in mind that if you do use tie, you may make your code harder to read.
Dave
In Section
Seekers of Perl Wisdom
|
|