Perl Monk, Perl Meditation | |
PerlMonks |
Re^2: How do I go from procedural to object oriented programming?by marinersk (Priest) |
on Apr 20, 2015 at 23:22 UTC ( [id://1124088]=note: print w/replies, xml ) | Need Help?? |
You have a class called Movies.
But this simple example belies the power of OO. You can now create multiple instances of that object. Firefly is a movie (as defined in your original hash, anyway). But so is Iron Man. And so on. Each of these is an instance of the movieobject, from the Moviesclass. You can create any number of movieobjects as you need in your code, for whatever purpose.
This wasn't meant teach you to code OO; it was meant to demonstrate how OO changes the way you look at programming. If it helps, great.
Good luck!
In Section
Seekers of Perl Wisdom
|
|