in reply to Thou Shall Not Covet thy Object's Internals

This why Perl ties are so nice. All you can do is use normal Perl data structrures --- the getting and setting of the actual fields in necessarily hidden.
  • Comment on Re: Thou Shall Not Covet thy Object's Internals

Replies are listed 'Best First'.
Re^2: Thou Shall Not Covet thy Object's Internals
by brian_d_foy (Abbot) on Jan 16, 2006 at 04:15 UTC

    Perl ties don't prevent you from accessing the object data. You can get the object back with tied, or say the return value from tie.

    my $object = tie my $scalar, 'Tie::Scalar::SomethingCool'; my $object2 = tied( $scalar );

    Of course, people have to do a little more work to do that, but the people that want to mess with your internals won't mind the work.

    --
    brian d foy <brian@stonehenge.com>
    Subscribe to The Perl Review