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.
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 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"; }
A side note: run_time is not as bad as some of the other subroutines in the module which are truly hairy.
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: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |