in reply to Thou Shall Not Covet thy Object's Internals
here is a normal usage of this module:
use Tie::Cycle; tie my $cycle, 'Tie::Cycle', [ qw( FFFFFF 000000 FFFF00 ) ]; print $cycle; # FFFFFF print $cycle; # 000000 print $cycle; # FFFF00 print $cycle; # FFFFFF back to the beginning
From the standpoint of a person who is used to getting at object internals, he has no hope here. In fact, higher management could install the Tie::Cycle module, and the programmers would be free to use the module, making use of normal Perl syntax but with Tie::Cycle semantics.
But in no case could they use their tied scalar to access their "object" in this case, $cycle.
It's funny that I wrote this post, because I used to hate Perl ties. My way of describing them was:
They take a perfectly obvious piece of Perl code and make it so you have no idea what it might do anymore.
But after reading Ovid's post, I guess I have to say
They take a Perl module whose privates might have been violated using OOP availability and allow Perl to do the FETCHing and STOREing for the programmer, with a large variety of available semantics.
|
---|
Replies are listed 'Best First'. | |
---|---|
(tye)Re: Thou Shall Not Covet thy Object's Internals
by tye (Sage) on Apr 26, 2001 at 02:33 UTC | |
Re: Re: Thou Shall Not Covet thy Object's Internals
by merlyn (Sage) on Apr 26, 2001 at 01:55 UTC | |
Re: Re: Thou Shall Not Covet thy Object's Internals
by hdp (Beadle) on Apr 26, 2001 at 01:57 UTC | |
Re^2: Thou Shall Not Covet thy Object's Internals
by brian_d_foy (Abbot) on Jan 16, 2006 at 04:19 UTC |