Hello choroba 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.
- How are you getting %movies_data from the module to the script below?
#!/usr/bin/perl
use strict;
use warnings;
# Movie is the only package name I found in the module,
# so I'm guessing it is also the module's name.
use Movie;
for my $title (sort keys %movies_data) {
my $movie = 'Movie'->new( title => $title,
map { (my $t = $_) =~ s/ /_/;
$t => $movies_data{$title}{$_} }
keys %{ $movies_data{$title} });
print $movie->movie_is, "\n";
}
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.
- Why did you constrain media and based_on? media could grow to include web series, music videos, and even video games (interactive movies). based_on includes so much more than the few things I included in the sample data. There are movies based on video games, board games, role-playing games, plays, etc. I'm waiting for the SyFy Original movie Qwerty vs. Dvorak which would be based on computer equipment without a company.
- How would your code handle movies with the start year "tbd"?
- It is easy to strip off the Moo formatting to make it normal OO? My web host does not have Moo installed.
- Does this code work in perl 5.8.8?
A side note: run_time is not as bad as some of the other subroutines in the module which are truly hairy.
No matter how hysterical I get, my problems are not time sensitive. So, relax, have a cookie, and a very nice day!
Lady Aleena
-
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.
|