CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [ChopperCharles] private and protected methods: Edit Log



budman
User

Mar 30, 2012, 5:50 PM


Views: 9649
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)


Edit Log:
Post edited by budman (User) on Mar 30, 2012, 5:52 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives