Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
The main concept in OO is that you construct a "Class" - representing generic properties, then you "Instantiate" one or more instances of that class.

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 :

my $m = Movie::->new (title=>'Great gatsby', year ....);
For your case, it would also be helpful to have a different class for a COLLECTION of movies (and to enable search).

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


In reply to Re: How do I go from procedural to object oriented programming? by NetWallah
in thread How do I go from procedural to object oriented programming? by Lady_Aleena

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (10)
As of 2024-04-23 08:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found