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, 2:15 PM


Views: 9783
Re: [ChopperCharles] private and protected methods

Static in the sense that the class is only loaded once.

Each instance does not create a new copy of the parent. So in a sense, these variables become static, but they are global to the class and subclasses via the accessors/setters.

If you wanted to track the number of instances loaded, you would use a class attribute, and increment it in new. Then create a sub DESTROY to decrement the attribute when objects are released.

Again, I think you should read the perldocs for OO and check out some comparisons, what you can and cannot do with Perl OOP. There are a lot of good examples in the perldocs that will answer a lot the questions you have and will have as you progress.

If you are looking for a good book on Perl OO - get "Object Oriented Perl" by D. Conway. He explains what each OO concept is and how it applies to Perl.


(This post was edited by budman on Mar 30, 2012, 2:17 PM)


Edit Log:
Post edited by budman (User) on Mar 30, 2012, 2:17 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