in reply to Re^2: Is Perl Truly an Object Oriented Language?
in thread Is Perl Truly an Object Oriented Language?
You missed the point. "host" and "port" aren't the base class' data members, they're our data members. We created an object of the class we're inheriting from, then we went and messed with its internals by adding our own data members to it. See the problem?
Here's an example (from WWW::Mechanize):
my $self = $class->SUPER::new( %default_parms, @_ ); $self->{page_stack} = []; $self->{quiet} = 0; $self->env_proxy(); push( @{$self->requests_redirectable}, 'POST' ); return bless $self, $class;
|
|---|