Phoenix.pm: Tied Variables

Doug Miles doug.miles at bpxinternet.com
Wed Jul 19 13:14:34 CDT 2000


Sniff, sniff.  Mmmmmmmm smells like a presentation to me... :)

Beaves at aol.com wrote:
> 
> Well, just to start a conversation...
> 
> I had to delve into tieing a HASH for my current project.  I had used a hash
> to store a users data, but when I decided to change to an object oriented
> system, I had to do something with all those HASH statements.
> 
> Tieing turned out to be a neat little tool so that I didn't have to worry if
> I missed a section of code that still used the hash statement.
> 
> Basically, that made the following statements equivalent.
> $USER->get_uid  < same as > $USER{uid}
> $USER->set_email('a at b.com') <same as > $USER{email} = 'a at b.com';
> 
> Perl has impressed me once again with its versatility...
> 
> I am no expert, but if anyone has a 'tie' question, let 'er rip...and I'll
> see what I can do.
> 
> Tieing does have limitations, but it is a neat tool to stash into your bag o'
> tricks.
> 
> Tim

-- 
- Doug

Don't anthropomorphize computers. They hate that.



More information about the Phoenix-pm mailing list