in reply to How do I go from procedural to object oriented programming?
In your case, the "Class" that stands out is "Movie" (Note - this is singular).
A movie has properties 'title', 'start year' , 'end year' , 'media' .. etc .
You would instantiate an instance of the 'Movie" class by :
For your case, it would also be helpful to have a different class for a COLLECTION of movies (and to enable search).my $m = Movie::->new (title=>'Great gatsby', year ....);
Let me know if this is heading in a direction that means something to you. I'm sure other monks will also chime in and offer more detailed code.
"You're only given one little spark of madness. You mustn't lose it." - Robin Williams
|
---|