Hello SimonPratt and thank you for stopping by. I have a few specific questions about the code you provided. I will be writing up something more general as a reply to my OP to show the true breadth of the module.

  1. Is Perl 5.16.2 required? I write for 5.8.8 since that is what my web host provides.
  2. How are you getting %movies_data from the module to the script below?
    #!/usr/bin/perl use strict; use warnings; # movie is the first package name I found in the module, # so I'm guessing it is also the module's name. use movie; my $library = library->new(name => "Lucky's"); foreach my $movie (values %movies_data) { $library->add_movie(movie->new(%$movie)); } $library->print();
    I see %movies_data but I don't see how you got it from the module. %movies_data is not something I want to have to copy and paste to the three scripts which use it now.
  3. Why doesn't end_year get a value if it does not have one? It needs an end year for run_time which you seem to have dropped.

You do not need to worry about adding movies with this module. I enter the data into the file by hand since the last time I did anything with the data file with a script, I accidentally dropped a value causing me to have to redo my research for the value for a lot of movies.

The module I am possibly rewriting has 7 hashes, 5 of which get sent out to scripts from the module. Some values of the hashes use the subroutines and other hashes to create some of the values. It is a big complex organism.

No matter how hysterical I get, my problems are not time sensitive. So, relax, have a cookie, and a very nice day!
Lady Aleena

In reply to Re^2: How do I go from procedural to object oriented programming? by Lady_Aleena
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":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.