Just another Perl shrine | |
PerlMonks |
Re^2: How do I go from procedural to object oriented programming?by marinersk (Priest) |
on Apr 20, 2015 at 22:48 UTC ( [id://1124078]=note: print w/replies, xml ) | Need Help?? |
Okay, so you need an object called movie. So how do we do that? This is OO -- it's all about the thing. So let's back off a bit and think about what a movie is. A bunch of these would be called movies. And that's a clue to the next step. A cat is a type of object. A house is a type of object. A movie is a type of object. They are all objects; but they are all different. We could say that they are somewhat defined by their attributes. So we will need to declare what type of object movie will be. In OO, we call that a Class. So we'll create a Class called Movies, and in it, define what attributes movies have.
In Section
Seekers of Perl Wisdom
|
|