in reply to Confused by OO & tie
Think of 'tie' as a way to have an object act like a hash.
Perl calls those methods on the object to implement the hash functionality.
Most objects are blessed references to hashes; they are implemented as hashes internally. Perl does not have a mechanism for having named attributes (ie instance variables) of an object. People use hashes to store the internal state of the object.my $value = $hash{$key}; my $object = tied %hash; $value = $object->FETCH($key);
It is quite possible to have a tied hash implemented using a hash reference object.
|
---|
In Section
Seekers of Perl Wisdom