Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: Confused by OO & tie

by davido (Cardinal)
on May 17, 2004 at 15:58 UTC ( #354016=note: print w/replies, xml ) Need Help??

in reply to Confused by OO & tie

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.


Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://354016]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2023-03-29 06:53 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (70 votes). Check out past polls.