in reply to Re: How do I go from procedural to object oriented programming?
in thread How do I go from procedural to object oriented programming?
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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: How do I go from procedural to object oriented programming?
by choroba (Cardinal) on Apr 22, 2015 at 07:59 UTC | |
by Lady_Aleena (Priest) on Apr 22, 2015 at 08:33 UTC | |
by choroba (Cardinal) on Apr 22, 2015 at 09:37 UTC | |
by Anonymous Monk on Apr 22, 2015 at 10:03 UTC | |
by Anonymous Monk on Apr 22, 2015 at 15:47 UTC |