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.
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.#!/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();
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.
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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |