
budman
User
Mar 30, 2012, 5:50 PM
Views: 7861
|
|
Re: [ChopperCharles] private and protected methods
|
|
|
Anytime we need access to the object, we make sure to call the method with $self-> this way Perl will pass the first arg for us. This is because $self was blessed. If you do use Data::Dumper; then run print Dumper($self) you will see how the hash is blessed. $self->run("something"); $self->__foo(@_); Now we have access to any of the object vars. The $self->run( ) is the same as run($self, @_); (try not to do this)
(This post was edited by budman on Mar 30, 2012, 5:52 PM)
|