On 7/4/05 at 2:06 PM, [EMAIL PROTECTED] (Mark Fuller) wrote:
> From: "Michael Peters" <[EMAIL PROTECTED]>
> > Not just that, but it also provides an easy way to pass variables
> > between methods as well as communicating between plugins and other
> > base classes.
>
> I'm not an OO guru. If I'm off base please forgive me. But, what's
> the difference between
>
> $self->param('var_name', 'var_value')
>
> and
>
> $self->var_name = 'var_value'
Use something like DataDumper to print out the object and you'll see.
use Data::Dumper;
print Dumper($self);
You're making an assumption about the underlying data structure, and may
be surprised at the result :-)
>
> > That is making the assumption that C::A will always be implemented
> > as a hash.
>
> No. It's my $self, right? ...
> But, why should C::A force me to use its method?
I think that's pretty typical OO encapsulation and also the point here.
Andrew
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/[email protected]/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]